Detection of latest Java version is buggy #1367
Labels
bash
related to bash shell or scripts
bug
Something isn't working
functions
related to the collection of bash functions in functions[-core] file
java
related to Java code, the Java Virtual Machine and directly related tooling (OpenJDK, Adoptium)
setup
related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)
update
related to updating software or the entire devonfw-ide
Milestone
Vising https://adoptium.net/ confirms that this is a bug and
21.0.1_12
is newer than21_35
.Indeed an edge-case from the version compare function but with Java a very relevant one.
The problem is that semantics like
.
vs._
are actually undefined.However, if both versions have an underscore (
_
) it seems kind of natural to first compare the prefix part before the underscore and only if equal then compare the suffix part so:21.0.1
<=>21
-->21.0.1
>21
12
<=>35
-->12
<35
.A remaining question would be the comparison of
21.0.1.12
with21_35
and IMHO there can not be a clear answer as it may depend on the project/product creating these versions.I guess for Java the suffix starting with the
_
is some kind of build number.The text was updated successfully, but these errors were encountered: