diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java index d5e69979..5ef36de9 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java @@ -43,9 +43,10 @@ public final class JvmInformation { * Returns the Java version this JVM implements. * * @return the Java version + * @throws NumberFormatException if the version could not be converted into an int * @since 1-alpha0 */ - public static int getJavaVersion() { + public static int getJavaVersion() throws NumberFormatException { String version = System.getProperty("java.version"); if (version.startsWith("1.")) // Omit "1." (if present) @@ -58,8 +59,8 @@ public final class JvmInformation { try { return Integer.parseInt(version); } catch (NumberFormatException exception) { - Logger.crash(new LogIssuer(JvmInformation.class, CodePart.ENGINE), "Could not parse Java version: Integer conversion failed for string \"" + version + "\""); - return Integer.MAX_VALUE; + Logger.crash(new LogIssuer(JvmInformation.class, CodePart.ENGINE), "Could not parse Java version: Integer conversion failed for string \"" + version + "\"", exception); + throw exception; } }