fix: accept single-point Maven range like [5.0,5.0]#201
Open
apoorva-01 wants to merge 1 commit into
Open
Conversation
Maven treats identical boundaries as an error only when a side is exclusive; both inclusive means exactly 5.0. Reject only the exclusive forms, matching Apache Maven's own parser. Signed-off-by: Apoorva Verma <vermaapoorva0510@gmail.com>
f4f7e3e to
1dc49ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MavenVersionRange.from_native("[5.0,5.0]")raisesRestrictionParseError, but[5.0,5.0]is valid Maven: both ends inclusive just means exactly 5.0, same as[5.0].The parser rejected any equal-boundary range regardless of brackets. Maven only errors when a side is exclusive (
(5.0,5.0),[5.0,5.0),(5.0,5.0]), since those are empty sets. I matched that, so[5.0,5.0]resolves tovers:maven/5.0and the exclusive forms still raise. Regression tests at theRestrictionandfrom_nativelevels fail before, pass after.I scoped this to the identical-boundaries case. The issue's other example is out-of-order overlap semantics that Maven doesn't pin down, so I used
Refs #142(notFixes) to keep the issue open, happy to take it separately if you can confirm the expected result.Refs #142