Fix AbsoluteMin comparison by absolute magnitude - #7540
Conversation
7c1b1ed to
ecf7664
Compare
|
This PR corrects AbsoluteMin.getMinValue to compare values by absolute magnitude while returning the original signed value. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7540 +/- ##
============================================
- Coverage 80.32% 80.31% -0.01%
- Complexity 7402 7404 +2
============================================
Files 812 812
Lines 23911 23915 +4
Branches 4704 4706 +2
============================================
+ Hits 19206 19208 +2
- Misses 3944 3945 +1
- Partials 761 762 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing as superseded by #7536, which has already been merged into master and covers the same absolute-magnitude fix while also handling null input and Integer.MIN_VALUE overflow. Thank you. |
Summary
Root cause
AbsoluteMin.getMinValuefiltered candidates using their absolute values, but then updated the result withMath.minon the raw signed values. A larger-magnitude negative number could therefore replace the correct candidate.Validation
javaccompilation and direct behavior checks passedgit diff --checkpassedmvn -Dtest=AbsoluteMinTest testreached test compilation, but the upstream checkout has unrelated missing-class compilation failures across existing tests before Surefire can select the focused testFixes #7537