harshitsingh070 opened a new pull request, #814:
URL: https://github.com/apache/wayang/pull/814

   ## Description
   
   Fixes #813
   
   `Record.compareTo()` attempted to cast the underlying `Object[]` values to 
`Comparable[]`.
   
   Since the runtime type of the array remains `Object[]`, this resulted in a 
`ClassCastException` when comparing records, even when the individual fields 
implemented `Comparable`.
   
   ## Changes
   
   - Replaced the invalid `Object[]` to `Comparable[]` array cast with 
element-wise comparison.
   - Preserved the existing field type validation.
   - Added regression tests for `Record.compareTo()` covering equality, 
ordering, tie-breaking, single-field records, and dissimilar field types.
   
   ## Testing
   
   Ran:
   
   ```text
   .\mvnw test -pl wayang-commons/wayang-basic 
"-Dtest=org.apache.wayang.basic.data.RecordTest"
   ```
   
   Result:
   
   ```text
   Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```
   
   Also ran the specific regression test:
   
   ```text
   .\mvnw test -pl wayang-commons/wayang-basic 
"-Dtest=org.apache.wayang.basic.data.RecordTest#compareToShouldNotThrowClassCastExceptionDueToArrayCast"
   ```
   
   Result:
   
   ```text
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to