Changeset 18811 in josm for trunk/test/unit


Ignore:
Timestamp:
2023-08-17T15:03:10+02:00 (16 months ago)
Author:
taylor.smock
Message:

Fix #23124: Azul Java 17.0.4.1 will cause a NumberFormatException

Java can have multiple dots instead of just two. Specifically, the Java version
specifier is $MAJOR.$MINOR.$SECURITY.$PATCH.

Previously, we assumed that there would only ever be two dots in the version
specifier, and got the first and last dot. Now we get the first and second dot.

In addition, this fixes some lint issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r18553 r18811  
    312312            System.setProperty("java.version", "9.1.2");
    313313            assertEquals(1, Utils.getJavaUpdate());
     314
     315            System.setProperty("java.version", "17.0.4.1+1-LTS");
     316            assertEquals(0, Utils.getJavaUpdate());
    314317        } finally {
    315318            System.setProperty("java.version", javaVersion);
Note: See TracChangeset for help on using the changeset viewer.