semver4j icon indicating copy to clipboard operation
semver4j copied to clipboard

Ivy version range `[1.0,2.0]` is not satisfied by `1.0`

Open MarcelBochtler opened this issue 2 years ago • 1 comments

Using

Requirement.buildIvy("[1.0,2.0]").isSatisfiedBy(Semver("1.0", Semver.SemverType.LOOSE))

in version 3.1.0 retuns false, but according to the ivy version-matchers specification, it should be true.

This is caused by this check: https://github.com/vdurmont/semver4j/blob/7653e418d610ffcd2811bcb55fd72d00d420950b/src/main/java/com/vdurmont/semver4j/Range.java#L34

Where in the right-hand side of the ||, "1.0".isEquivalentTo("1.0.0") is checked, which then internally calls "1.0".isEqualTo("1.0.0").

This issue might be related to https://github.com/vdurmont/semver4j/issues/59.

MarcelBochtler avatar Jul 02 '22 12:07 MarcelBochtler

@MarcelBochtler if you are still interesting, I've made copy of this lib and fix bug reported by you. Look for version 2.0.1

piotrooo avatar Jul 22 '22 22:07 piotrooo