Skip to content

Conversation

@sttk
Copy link
Owner

@sttk sttk commented Apr 27, 2025

Closes #5

@sttk sttk requested a review from Copilot April 27, 2025 14:12
Copy link

Copilot AI left a 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 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 sttk requested a review from Copilot April 27, 2025 14:30
Copy link

Copilot AI left a 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 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() {

@sttk sttk merged commit f228ac9 into main Apr 27, 2025
12 checks passed
@sttk sttk deleted the change_reason_type_from_record_to_object branch April 27, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the type of the reason from Record to Object

2 participants