#23124 closed defect (fixed)
java.lang.NumberFormatException for "openjdk 17.0.4.1" from Zulu
Reported by: | hansfn | Owned by: | hansfn |
---|---|---|---|
Priority: | minor | Milestone: | 23.08 |
Component: | Core | Version: | tested |
Keywords: | template_report | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- Launch JOSM
What is the expected result?
Start without error
What happens instead?
Starts normally with severe error:
2023-08-16 10:35:08.073 SEVERE: java.lang.NumberFormatException: For input string: "0.4"
The reason is that the version number consists of 4 integers separated by dots, not 3 as expected.
See line 1751 of Utils.java. I assume you could just count the dots and remove the last dot and integer.
Please provide any additional information below. Attach a screenshot if possible.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2023-07-31 18:33:06 +0200 (Mon, 31 Jul 2023) Revision:18789 Build-Date:2023-08-01 01:30:56 URL:https://josm.openstreetmap.de/svn/trunk Identification: JOSM/1.5 (18789 en) Windows 10 64-Bit OS Build number: Windows 10 Enterprise 2009 (19045) Memory Usage: 119 MB / 494 MB (26 MB allocated, but free) Java version: 17.0.4.1+1-LTS, Azul Systems, Inc., OpenJDK Client VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1080 (scaling 1.25×1.25) \Display1 2560×1440 (scaling 1.00×1.00) \Display2 2560×1440 (scaling 1.00×1.00) Maximum Screen Size: 2560×1440 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: Cp1252 System property sun.jnu.encoding: Cp1252 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Plugins: + conflation (0.6.11) + jts (36004) + todo (133) + utilsplugin2 (36097) Validator rules: + http://osm.wzh.be/josm/different_buildings/buildings-import.validator.mapcss Last errors/warnings: - 00000.365 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF' - 00000.366 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF' - 00002.423 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl - 00003.326 W: Unable to request certificate of https://roottest-g3.pkioverheid.nl - 00007.847 E: java.lang.NumberFormatException: For input string: "0.4"
Attachments (0)
Change History (6)
comment:1 by , 14 months ago
Description: | modified (diff) |
---|
comment:2 by , 14 months ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
comment:3 by , 14 months ago
Is it because you are testing getJavaVersion()
instead of getJavaUpdate()
? I linked to a line number and not the function so it's an easy mistake, but it's quite clear that version.substring(firstDotPos + 1, lastDotPos)
will return "0.4" for "17.0.4.1".
comment:6 by , 14 months ago
Milestone: | → 23.08 |
---|
I wasn't able to reproduce. Can you give us the actual stacktrace?
For reference, I wrote a test to try and reproduce, given your problem statement.
src/org/openstreetmap/josm/tools/Utils.java
test/unit/org/openstreetmap/josm/tools/UtilsTest.java