Skip to content

Conversation

@jeremylong
Copy link
Collaborator

We've noticed intermittent exceptions, Comparison method violates its general contract!.As such, I had Amp take a look at the compareTo and equals of Cpe.java, and this is what it came up with:

• Primary Bug (FIXED): compareVersions mixed Long numeric comparison with lexicographic fallback when numbers exceeded Long.MAX_VALUE, violating transitivity
• Fix: Use BigInteger for all numeric comparisons
• Locale Dependency (FIXED): compareAttribute used default locale for toLowerCase() which could cause non-deterministic behavior
• Fix: Use Locale.ROOT for consistent behavior across all environments

I'm not convinced this was the root cause of the exception - but it does improve the class a little. Note that the code changes in this PR are entirely AI-generated.

@chadlwilson
Copy link
Contributor

chadlwilson commented Oct 15, 2025

Edit: Moved my reproducer to #286

@jeremylong jeremylong closed this Nov 4, 2025
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.

3 participants