Skip to content

fix: accept single-point Maven range like [5.0,5.0]#201

Open
apoorva-01 wants to merge 1 commit into
aboutcode-org:mainfrom
apoorva-01:fix/142-maven-identical-inclusive-boundaries
Open

fix: accept single-point Maven range like [5.0,5.0]#201
apoorva-01 wants to merge 1 commit into
aboutcode-org:mainfrom
apoorva-01:fix/142-maven-identical-inclusive-boundaries

Conversation

@apoorva-01

@apoorva-01 apoorva-01 commented Jul 1, 2026

Copy link
Copy Markdown

MavenVersionRange.from_native("[5.0,5.0]") raises RestrictionParseError, 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 to vers:maven/5.0 and the exclusive forms still raise. Regression tests at the Restriction and from_native levels 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 (not Fixes) to keep the issue open, happy to take it separately if you can confirm the expected result.

Refs #142

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>
@apoorva-01 apoorva-01 force-pushed the fix/142-maven-identical-inclusive-boundaries branch from f4f7e3e to 1dc49ff Compare July 2, 2026 02:51
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.

1 participant