Skip to content

Commit

Permalink
[WFCORE-6506] Initial Java releases contain neither minor nor micro p…
Browse files Browse the repository at this point in the history
…art in the version string. Adjusting tests to reflect this
  • Loading branch information
ropalka committed Sep 20, 2023
1 parent ef07287 commit 17a25bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void testCreateConfiguration() throws UnknownHostException {
private static int getJavaVersion() throws NumberFormatException {
final String versionString = System.getProperty("java.version");
int indexOfDot = versionString.indexOf('.');
return Integer.valueOf(versionString.substring(0, indexOfDot)).intValue();
return Integer.valueOf(indexOfDot > 0 ? versionString.substring(0, indexOfDot) : versionString).intValue();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private void testJPMSArguments(final Collection<String> command, final int expec
private static int getJavaVersion() throws NumberFormatException {
final String versionString = System.getProperty("java.version");
int indexOfDot = versionString.indexOf('.');
return Integer.valueOf(versionString.substring(0, indexOfDot)).intValue();
return Integer.valueOf(indexOfDot > 0 ? versionString.substring(0, indexOfDot) : versionString).intValue();
}

private void testModularJvmArguments(final Collection<String> command, final int expectedCount) {
Expand Down

0 comments on commit 17a25bf

Please sign in to comment.