Skip to content

Commit

Permalink
Small refactor (simplify formatting JDK version)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermocalvo committed Aug 20, 2024
1 parent e00fd6a commit c4659f1
Showing 1 changed file with 3 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,9 @@ private static String getJdkVersion(int major, int minor) {
return "JDK 1.3";
} else if (major == 48) {
return "JDK 1.4";
} else if (major == 49) {
return "JDK 5.0";
} else if (major == 50) {
return "JDK 6";
} else if (major == 51) {
return "JDK 7";
} else if (major == 52) {
return "JDK 8";
} else if (major == 53) {
return "JDK 9";
} else if (major == 54) {
return "JDK 10";
} else if (major == 55) {
return "JDK 11";
} else if (major == 56) {
return "JDK 12";
} else if (major == 57) {
return "JDK 13";
} else if (major == 58) {
return "JDK 14";
} else if (major == 59) {
return "JDK 15";
} else if (major == 60) {
return "JDK 16";
} else if (major == 61) {
return "JDK 17";
} else if (major == 62) {
return "JDK 18";
} else if (major == 63) {
return "JDK 19";
} else if (major == 64) {
return "JDK 20";
} else if (major == 65) {
return "JDK 21";
} else if (major == 66) {
return "JDK 22";
} else if (major == 67) {
return "JDK 23";
} else if (major >= 49 && major <= 70) {
// JDK 5 to 26, according to: https://andbin.github.io/java-versions-cheat-sheet/
return "JDK " + (major - 44);
}
return "Version " + major + "." + minor;
}
Expand Down

0 comments on commit c4659f1

Please sign in to comment.