update!: changed the type of the reason field from Record to Object#6
Merged
update!: changed the type of the reason field from Record to Object#6
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the type of the reason field in the Exc exception class from Record to Object and adjusts related test cases and documentation accordingly.
- Changed the type of the reason field and corresponding constructors in Exc.java.
- Updated tests in ExcTest.java to cover reasons as Record, enum, and String.
- Revised comments and README.md to reflect these changes.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/java/com/github/sttk/errs/ExcTest.java | Renamed some test methods and updated expected messages. |
| src/main/java/com/github/sttk/errs/Exc.java | Changed the reason field type and updated related methods. |
| README.md | Updated documentation to reflect the new type for reason. |
Comments suppressed due to low confidence (1)
src/test/java/com/github/sttk/errs/ExcTest.java:35
- [nitpick] Consider renaming the test method 'with_Record_reason()' to use standard camelCase naming for consistency with Java conventions (e.g., 'withRecordReason()').
void with_Record_reason() {
sttk
commented
Apr 27, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Exc exception class by changing the type of its reason field from Record to Object and simplifying the message formatting logic, while also updating tests and documentation accordingly.
- Update in Exc.java: Changed type of the reason field, modified constructors, accessor, getMessage, and toString methods to work with Object.
- Update in ExcTest.java: Adjusted test method names, assertions, and expected outputs to accommodate the new formatting and support multiple reason types.
- Update in README.md: Revised documentation to reflect that the reason is now an Object (typically a Record).
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/test/java/com/github/sttk/errs/ExcTest.java | Updated tests to cover reason types (record, enum, String) and adjusted expected outputs and test method names. |
| src/main/java/com/github/sttk/errs/Exc.java | Changed field type from Record to Object and simplified message formatting, including serialization changes. |
| README.md | Updated text to clarify that the reason is represented by an Object (typically a Record). |
Comments suppressed due to low confidence (1)
src/test/java/com/github/sttk/errs/ExcTest.java:35
- [nitpick] The test method name 'with_Record_reason' might be misleading now that the reason field is of type Object. Consider renaming it to something like 'with_object_reason' to better reflect the updated design.
void with_Record_reason() {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5