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 3cacede..aeecd17 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 @@ -19,6 +19,9 @@ package de.staropensource.sosengine.base.data.info; +import de.staropensource.sosengine.base.logging.Logger; +import de.staropensource.sosengine.base.types.CodePart; +import de.staropensource.sosengine.base.classes.logging.LogIssuer; import org.jetbrains.annotations.NotNull; import java.lang.management.ManagementFactory; @@ -52,7 +55,12 @@ public final class JvmInformation { version = version.substring(0, version.indexOf(".")); } - return Integer.parseInt(version); + 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; + } } /**