Commits

Anonymous committed d003acc

As the JVM bug is specific to the sun implementation, is4947220Fixed
now returns true for other JVM implementations.
Also is4947220Fixed has been changed so as to work with future major
version java releases.

  • Participants
  • Parent commits 110e4c6
  • Branches detect_fixed_windows_unicode_jvms

Comments (0)

Files changed (1)

File src/main/java/com/atlassian/utils/process/ExternalProcessImpl.java

         final String jvmVersion = System.getProperty("java.version");
         final String jvmVendor = System.getProperty("java.vendor");
         int minorVersion = -1;
+        double majorVersion = -1.0;
         if (jvmVersion.split("_").length == 2) {
             try {
+                majorVersion = Double.parseDouble(jvmVersion.substring(0, 3));
                 minorVersion = Integer.parseInt(jvmVersion.split("_")[1]);
             }
             catch (NumberFormatException e) {
-                LOG.error("Failed to parse the JVM minor version", e);
+                LOG.error("Failed to parse the JVM version", e);
             }
         }
         for (String vendor : Arrays.asList("sun", "oracle", "openjdk")) {
             if (jvmVendor.toLowerCase(Locale.US).contains(vendor)) {
-               if (jvmVersion.startsWith("1.7")) {
-                   return true;
-               }
-               if (jvmVersion.startsWith("1.6") && minorVersion >= 30) {
-                   return true;
-               }
+                if (majorVersion == 1.6 && minorVersion < 30) {
+                    return false;
+                }
+                if (majorVersion < 1.6) {
+                    return false;
+                }
             }
         }
-        return false;
+        return true;
     }
 
     private String quoteString(String value) {
         }
         return false;
     }
-    
+
     private void wrapUpProcess() {
         if (process == null || finished.get()) {
             return;