-
Notifications
You must be signed in to change notification settings - Fork 27
Add strict kind validation to event classes #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add strict kind validation to event classes #234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds strict kind validation to concrete event implementations to ensure each event class validates that its kind field matches the expected Kind enum value.
- Adds
validateKind()method overrides to all concrete event classes - Adds a test to verify validation fails when kind values are mismatched
- Updates README to document the new validation behavior
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| ValidateKindTest.java | New test verifying AssertionError is thrown for mismatched kind values |
| Various event classes | Added validateKind() method overrides to enforce expected Kind enum values |
| README.md | Added documentation about the new event validation behavior |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
| } | ||
|
|
||
| @Override | ||
| public void validateKind() { |
Copilot
AI
Jul 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.
| public void validateKind() { | |
| protected void validateKind() { |
Summary
Testing
mvn -q verifyhttps://chatgpt.com/codex/tasks/task_b_688a84fdfbb083318d79b9337c990fcb