Affected version: 4.0.0-beta-5+
Description:
BuildHelper.normalizeJavaVersion() at line 67 checks jdk.length() == 3 before checking against the list of known 1.x versions:
public static String normalizeJavaVersion(String jdk) {
if (jdk != null
&& jdk.length() == 3
&& Arrays.asList("1.5", "1.6", "1.7", "1.8").contains(jdk)) {
jdk = jdk.substring(2);
}
return jdk;
}
The length == 3 check is redundant with the contains() call (all items in the list are length 3), but it creates an invisible coupling: if someone ever adds a version like "1.10" (length 4) to the list, the normalization would silently skip it even though it should be stripped to "10". This makes the code fragile against future maintenance.
Low priority — only a concern if Java versioning changes format.
Affected version: 4.0.0-beta-5+
Description:
BuildHelper.normalizeJavaVersion()at line 67 checksjdk.length() == 3before checking against the list of known 1.x versions:The
length == 3check is redundant with thecontains()call (all items in the list are length 3), but it creates an invisible coupling: if someone ever adds a version like"1.10"(length 4) to the list, the normalization would silently skip it even though it should be stripped to"10". This makes the code fragile against future maintenance.Low priority — only a concern if Java versioning changes format.