Hello everyone,

I hope this is the right place to report issues.

I just wanted to run an application which has a dependency to Apache Pivot 
2.0.4.
The application calls org.apache.pivot.wtk.DesktopApplicationContext.main which 
inherits from ApplicationContext.
ApplicationContext has a static initializer block with this code line:

jvmVersion = Version.decode(System.getProperty("java.vm.version"));


With my SAP JVM the system property has this string:
8.1.028 25.51-b14

Which results in a
Exception in thread "main" java.lang.NumberFormatException: For input string: 
"028 25"
       at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
       at java.lang.Integer.parseInt(Integer.java:580)
       at java.lang.Byte.parseByte(Byte.java:149)
       at java.lang.Byte.parseByte(Byte.java:175)
       at org.apache.pivot.util.Version.decode(Version.java:156)


If you do not have a SAP JVM, you can easily reproduce the issue with this code 
line:
Version.decode("8.1.028 25.51-b14");


Maybe the problem is that the requested property is java.vm.version. When I try 
with just java.version, it does not throw an exception:
Version v = Version.decode(System.getProperty("java.version"));
System.out.println(v.getMajorRevision());
System.out.println(v.getMinorRevision());
System.out.println(v.getMaintenanceRevision());
System.out.println(v.getUpdateRevision());

Output:
1
8
0
112

(The getProperty for java.version returns 1.8.0_112)


Best regards,
Daniel


Reply via email to