slachiewicz opened a new pull request, #12947:
URL: https://github.com/apache/maven/pull/12947

   Three independent fixes in `maven-artifact`'s version handling.
   
   - **Release-qualifier ordering.** `1-ga1` compared equal to `1`, while 
`1-ga1 < 1-ga2`. That breaks the transitivity contract `Comparable` requires, 
and contradicts the intent stated in the code's own comment (`1-rc1 < 1`, 
`1-ga1 > 1`). `CombinationItem.compareTo(null)` consulted only the string part 
and never the digit. Includes a `VersionRange`-level regression test: an exact 
range `[1.2.3]` no longer matches `1.2.3-ga2`.
   - **`hashCode`/`equals` consistency.** `DefaultArtifactVersion.equals` is 
defined via `compareTo`, but `hashCode` was structural, so two order-equal 
versions could hash differently. `HashSet` and `TreeSet` built from the same 
pair disagreed on size. `equals` and `compareTo` are unchanged, so no 
resolution outcome moves.
   - **Parsing bound.** `ComparableVersion` now rejects version strings longer 
than 256 characters. Nested `-` separators recurse per level and long digit 
runs cost quadratic time in `BigInteger`; on a reduced worker-thread stack the 
cold overflow floor is a few hundred levels. Nothing in this repository has a 
version string over 40 characters. Measurements are in the commit body.
   
   Each fix is a separate commit and independently revertible.
   


-- 
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