@SuppressWarnings({"ResultOfMethodCallIgnored", "ConstantConditions"}) @Test public void testIsJavaOld() { Integer.parseInt(Config.MAX_JAVA_VERSION); if (Config.MAX_JAVA_VERSION.startsWith("1.")) Integer.parseInt(Config.MAX_JAVA_VERSION.substring(2)); else Integer.parseInt(Config.MAX_JAVA_VERSION); assertEquals(4, TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL).size()); int current = Integer.parseInt(Config.MAX_JAVA_VERSION); assertFalse(SystemDependent.isJavaValid("1.0")); assertFalse(SystemDependent.isJavaValid("1.1")); assertFalse(SystemDependent.isJavaValid("1.2")); assertFalse(SystemDependent.isJavaValid("1.8.0_92-b14")); assertFalse(SystemDependent.isJavaValid("1.8.0_110")); assertTrue(SystemDependent.isJavaValid("1.8.0_111")); assertTrue(SystemDependent.isJavaValid("1.8.0_144-b01")); assertTrue(SystemDependent.isJavaValid("1.8.0_155-b01")); assertTrue(SystemDependent.isJavaValid("9")); assertTrue(SystemDependent.isJavaValid("9.1")); assertTrue(SystemDependent.isJavaValid("1.9.0")); assertTrue(SystemDependent.isJavaValid("10.0")); assertTrue(SystemDependent.isJavaValid("11.0")); assertTrue(SystemDependent.isJavaValid(Config.MIN_JAVA_VERSION_FULL)); assertTrue(SystemDependent.isJavaValid(Config.MAX_JAVA_VERSION + ".0")); assertTrue(SystemDependent.isJavaValid(Config.MIN_JAVA_VERSION + ".1")); assertTrue(SystemDependent.isJavaValid(current + ".0")); assertFalse(SystemDependent.isJavaValid((current + 1) + ".0")); }
public static boolean isJavaValid(String version) { List<Integer> given = TextUtils.listOfInts(version.trim()); List<Integer> req = TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL); if (req.get(0) == 1) req.remove(0); if (given.isEmpty()) return false; if (given.get(0) > req.get(0) && given.get(0) <= Integer.parseInt(Config.MAX_JAVA_VERSION)) return true; if (given.size() < 2) return false; if (given.get(1) < 8) return false; if (given.get(1) > 8) return true; if (given.size() < 3) return false; if (given.get(2) > 0) return true; if (given.size() < 4) return false; return given.get(3) >= req.get(2); }
SystemDependent { public static boolean isJavaValid(String version) { List<Integer> given = TextUtils.listOfInts(version.trim()); List<Integer> req = TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL); if (req.get(0) == 1) req.remove(0); if (given.isEmpty()) return false; if (given.get(0) > req.get(0) && given.get(0) <= Integer.parseInt(Config.MAX_JAVA_VERSION)) return true; if (given.size() < 2) return false; if (given.get(1) < 8) return false; if (given.get(1) > 8) return true; if (given.size() < 3) return false; if (given.get(2) > 0) return true; if (given.size() < 4) return false; return given.get(3) >= req.get(2); } }
SystemDependent { public static boolean isJavaValid(String version) { List<Integer> given = TextUtils.listOfInts(version.trim()); List<Integer> req = TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL); if (req.get(0) == 1) req.remove(0); if (given.isEmpty()) return false; if (given.get(0) > req.get(0) && given.get(0) <= Integer.parseInt(Config.MAX_JAVA_VERSION)) return true; if (given.size() < 2) return false; if (given.get(1) < 8) return false; if (given.get(1) > 8) return true; if (given.size() < 3) return false; if (given.get(2) > 0) return true; if (given.size() < 4) return false; return given.get(3) >= req.get(2); }  }
SystemDependent { public static boolean isJavaValid(String version) { List<Integer> given = TextUtils.listOfInts(version.trim()); List<Integer> req = TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL); if (req.get(0) == 1) req.remove(0); if (given.isEmpty()) return false; if (given.get(0) > req.get(0) && given.get(0) <= Integer.parseInt(Config.MAX_JAVA_VERSION)) return true; if (given.size() < 2) return false; if (given.get(1) < 8) return false; if (given.get(1) > 8) return true; if (given.size() < 3) return false; if (given.get(2) > 0) return true; if (given.size() < 4) return false; return given.get(3) >= req.get(2); }  static int getBundleOrFileID(); @SuppressWarnings("UseSpecificCatch") static void appendSpotlightApplication(String name, List<ExtPath> res); static void appendPathApplication(List<ExtPath> res); static Charset getEncoding(); static String getDefaultTheme(); static String getHome(); static String getAppHome(); static String getManagerPluginsDir(); static String getMetaPluginsDir(); static String getJavaExec(); static String safeArg(String arg); static boolean isJavaValid(String version); static boolean canMakeIos(); static boolean canMakeMacos(); static boolean canMakeUwp(); static boolean canWrite(File f); static boolean makeExecutable(File file); static String getFileManagerName(); static Collection<File> getBlacklistedLocations(); static String canAccessPath(String appName, String location); static boolean is64Bit(); static String getOSBinName(); static String getBashExec(); static String getFullName(); static Map<String, String> getEnvWithFixedPaths(); static String getDeploymentTarget(); }
SystemDependent { public static boolean isJavaValid(String version) { List<Integer> given = TextUtils.listOfInts(version.trim()); List<Integer> req = TextUtils.listOfInts(Config.MIN_JAVA_VERSION_FULL); if (req.get(0) == 1) req.remove(0); if (given.isEmpty()) return false; if (given.get(0) > req.get(0) && given.get(0) <= Integer.parseInt(Config.MAX_JAVA_VERSION)) return true; if (given.size() < 2) return false; if (given.get(1) < 8) return false; if (given.get(1) > 8) return true; if (given.size() < 3) return false; if (given.get(2) > 0) return true; if (given.size() < 4) return false; return given.get(3) >= req.get(2); }  static int getBundleOrFileID(); @SuppressWarnings("UseSpecificCatch") static void appendSpotlightApplication(String name, List<ExtPath> res); static void appendPathApplication(List<ExtPath> res); static Charset getEncoding(); static String getDefaultTheme(); static String getHome(); static String getAppHome(); static String getManagerPluginsDir(); static String getMetaPluginsDir(); static String getJavaExec(); static String safeArg(String arg); static boolean isJavaValid(String version); static boolean canMakeIos(); static boolean canMakeMacos(); static boolean canMakeUwp(); static boolean canWrite(File f); static boolean makeExecutable(File file); static String getFileManagerName(); static Collection<File> getBlacklistedLocations(); static String canAccessPath(String appName, String location); static boolean is64Bit(); static String getOSBinName(); static String getBashExec(); static String getFullName(); static Map<String, String> getEnvWithFixedPaths(); static String getDeploymentTarget();  }