Skip to content

fix: version comparison loop index bug, Range.parse() silent always-true, and base-tar catalog entry#11

Merged
deer merged 1 commit intomainfrom
version_fixes
Apr 8, 2026
Merged

fix: version comparison loop index bug, Range.parse() silent always-true, and base-tar catalog entry#11
deer merged 1 commit intomainfrom
version_fixes

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented Apr 8, 2026

  • ModuleDescriptor.Version: Fix off-by-one index bug in compare() where the loop used elements1.get(0).compareTo(elements2.get(0)) on every iteration instead of get(i). This caused any two versions sharing a first element (e.g. 0.21.5 and 0.21.6-SNAPSHOT) to compareas equal, breaking version preference during resolution.
  • Artifact.Version.Range: Fix Range.parse() for standalone (,X) ranges with a non-inclusive closing bracket (e.g. (,1.0), strictly less-than). The upper bound was only assigned inside if (bound.isInclusive()), so the non-inclusive case produced Range(null, null) which matches every version. Fixed by assigning upper = bound unconditionally. (Disjoint ranges like (,1.1),(1.1,) are unaffected — they overwrite upper with the second part regardless.)
  • module-catalog.properties: Add missing build.base.tar entry.

@deer deer merged commit 87fdd3f into main Apr 8, 2026
1 check passed
@deer deer deleted the version_fixes branch April 8, 2026 11:58
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