Skip to content

Commit

Permalink
JavaService, parse java versions like 21-internal
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke committed Aug 23, 2024
1 parent a65e677 commit 85be879
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ int parseSystemProperty(String versionIn) {
if (dot != -1) {
version = version.substring(0, dot);
}

int hyphen = version.indexOf("-"); // 21-internal
if (hyphen != -1) {
version = version.substring(0, hyphen);
}
}

return Integer.parseInt(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public void testParseSystemProperty() {
assertEquals(11, javaService.parseSystemProperty("11.0.2"));
assertEquals(12, javaService.parseSystemProperty("12"));
assertEquals(13, javaService.parseSystemProperty("13.0.1"));
assertEquals(21, javaService.parseSystemProperty("21-internal"));
}

@Test
Expand Down

0 comments on commit 85be879

Please sign in to comment.