package com.timgroup.tucker.info.component;

import com.timgroup.tucker.info.Component;
import com.timgroup.tucker.info.Report;
import com.timgroup.tucker.info.Status;

/**
 * Reports version information about the JVM in which this application is running.
 * <p>
 * The version comes from a query of the java system properties.
 *
 * @see java.lang.System#getProperties
 */
public class JvmVersionComponent extends Component {
    public static final String versionInfoString;

    static {
        String basicVersion = System.getProperty("java.version");
        String vendorVersion = System.getProperty("java.vendor.version");
        if (basicVersion.equals("10") || basicVersion.startsWith("10.") || basicVersion.equals("11") || basicVersion.startsWith("11.")) {
            versionInfoString = basicVersion + " (" + vendorVersion + ")";
        }
        else {
            versionInfoString = basicVersion;
        }
    }

    public JvmVersionComponent() {
        super("jvmversion", "JVM Version");
    }

    @Override
    public Report getReport() {
        return new Report(Status.INFO, versionInfoString);
    }

}

@@ -499,21 +499,22 @@
  String 
-basic
+vendor
 Version 
@@ -540,16 +540,23 @@
 y(%22java.
+vendor.
 version%22
@@ -565,38 +565,37 @@
 %0A        String 
-vendor
+basic
 Version = System
@@ -605,39 +605,32 @@
 tProperty(%22java.
-vendor.
 version%22);%0A     
@@ -640,130 +640,29 @@
 if (
-basicVersion.equals(%2210%22) %7C%7C basicVersion.startsWith(%2210.%22) %7C%7C basicVersion.equals(%2211%22) %7C%7C basicVersion.startsWith(%2211.%22)
+vendorVersion != null
 ) %7B%0A

Simplify formatting JVM version and avoid having to configure each new release