/** * Checks that the java specification version {@code targetVersion} * required by {@code resource} is compatible with the current installation. */ public static void checkJavaVersion(String resource, String targetVersion) { JavaVersion version = JavaVersion.parse(targetVersion); if (JavaVersion.current().compareTo(version) < 0) { throw new IllegalStateException( String.format( Locale.ROOT, "%s requires Java %s:, your system: %s", resource, targetVersion, JavaVersion.current().toString() ) ); } }
public static JavaVersion parse(String value) { Objects.requireNonNull(value); if (!isValid(value)) { throw new IllegalArgumentException("value"); } List<Integer> version = new ArrayList<>(); String[] components = value.split("\\."); for (String component : components) { version.add(Integer.valueOf(component)); } return new JavaVersion(version); }
public static void checkVersionFormat(String targetVersion) { if (!JavaVersion.isValid(targetVersion)) { throw new IllegalStateException( String.format( Locale.ROOT, "version string must be a sequence of nonnegative decimal integers separated by \".\"'s and may have " + "leading zeros but was %s", targetVersion ) ); } }
@Override public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } return compareTo((JavaVersion) o) == 0; }
public static JavaVersion parse(String value) { if (value == null) { throw new NullPointerException("value"); } if ("".equals(value)) { throw new IllegalArgumentException("value"); } List<Integer> version = new ArrayList<>(); String[] components = value.split("\\."); for (String component : components) { version.add(Integer.valueOf(component)); } return new JavaVersion(version); }
/** * Checks that the java specification version {@code targetVersion} * required by {@code resource} is compatible with the current installation. */ public static void checkJavaVersion(String resource, String targetVersion) { JavaVersion version = JavaVersion.parse(targetVersion); if (JavaVersion.current().compareTo(version) < 0) { throw new IllegalStateException( String.format( Locale.ROOT, "%s requires Java %s:, your system: %s", resource, targetVersion, JavaVersion.current().toString() ) ); } }
public static JavaVersion parse(String value) { Objects.requireNonNull(value); if (!isValid(value)) { throw new IllegalArgumentException("value"); } List<Integer> version = new ArrayList<>(); String[] components = value.split("\\."); for (String component : components) { version.add(Integer.valueOf(component)); } return new JavaVersion(version); }
public static void checkVersionFormat(String targetVersion) { if (!JavaVersion.isValid(targetVersion)) { throw new IllegalStateException( String.format( Locale.ROOT, "version string must be a sequence of nonnegative decimal integers separated by \".\"'s and may have leading zeros but was %s", targetVersion ) ); } }
@Override public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } return compareTo((JavaVersion) o) == 0; }
/** * Checks that the java specification version {@code targetVersion} * required by {@code resource} is compatible with the current installation. */ public static void checkJavaVersion(String resource, String targetVersion) { JavaVersion version = JavaVersion.parse(targetVersion); if (JavaVersion.current().compareTo(version) < 0) { throw new IllegalStateException( String.format( Locale.ROOT, "%s requires Java %s:, your system: %s", resource, targetVersion, JavaVersion.current().toString() ) ); } }
public static JavaVersion parse(String value) { Objects.requireNonNull(value); if (!isValid(value)) { throw new IllegalArgumentException("value"); } List<Integer> version = new ArrayList<>(); String[] components = value.split("\\."); for (String component : components) { version.add(Integer.valueOf(component)); } return new JavaVersion(version); }
public static void checkVersionFormat(String targetVersion) { if (!JavaVersion.isValid(targetVersion)) { throw new IllegalStateException( String.format( Locale.ROOT, "version string must be a sequence of nonnegative decimal integers separated by \".\"'s and may have " + "leading zeros but was %s", targetVersion ) ); } }
@Override public boolean equals(Object o) { if (o == null || o.getClass() != getClass()) { return false; } return compareTo((JavaVersion) o) == 0; }
/** * Checks that the java specification version {@code targetVersion} * required by {@code resource} is compatible with the current installation. */ public static void checkJavaVersion(String resource, String targetVersion) { JavaVersion version = JavaVersion.parse(targetVersion); if (JavaVersion.current().compareTo(version) < 0) { throw new IllegalStateException( String.format( Locale.ROOT, "%s requires Java %s:, your system: %s", resource, targetVersion, JavaVersion.current().toString() ) ); } }
public static void checkVersionFormat(String targetVersion) { if (!JavaVersion.isValid(targetVersion)) { throw new IllegalStateException( String.format( Locale.ROOT, "version string must be a sequence of nonnegative decimal integers separated by \".\"'s and may have leading zeros but was %s", targetVersion ) ); } }