Skip to content

Commit

Permalink
Issue 1658 Make JP buildable on Java 10 - Implementing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kotari4u committed Jun 30, 2018
1 parent a82e27c commit d77c144
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ script: mvn test -P AlsoSlowTests
jdk:
- oraclejdk8
- oraclejdk9
- oraclejdk10
notifications:
webhooks:
urls:
Expand Down
Expand Up @@ -49,9 +49,9 @@ protected boolean isJava10() {
return System.getProperty("java.version").startsWith("10.");
}

protected boolean isJavaVersionAbove9() {
protected boolean isJavaVersion9OrAbove() {
String jdkVersion = System.getProperty("java.version");
return Integer.parseInt(jdkVersion.substring(0,jdkVersion.indexOf('.'))) >= 9;
return Integer.parseInt(jdkVersion.substring(0, jdkVersion.indexOf('.'))) >= 9;
}

protected boolean isJava8() {
Expand Down
Expand Up @@ -173,7 +173,7 @@ public void testGetDeclaredMethods() {
.filter(m -> m.accessSpecifier() != AccessSpecifier.PRIVATE && m.accessSpecifier() != AccessSpecifier.DEFAULT)
.sorted((a, b) -> a.getName().compareTo(b.getName()))
.collect(Collectors.toList());
if (isJavaVersionAbove9()) {
if (isJavaVersion9OrAbove()) {
assertEquals(69, methods.size());
} else {
assertEquals(67, methods.size());
Expand All @@ -182,7 +182,7 @@ public void testGetDeclaredMethods() {
assertEquals(false, methods.get(0).isAbstract());
assertEquals(1, methods.get(0).getNumberOfParams());
assertEquals("int", methods.get(0).getParam(0).getType().describe());
if (isJavaVersionAbove9()) {
if (isJavaVersion9OrAbove()) {
assertEquals("compareTo", methods.get(6).getName());
assertEquals(false, methods.get(6).isAbstract());
assertEquals(1, methods.get(6).getNumberOfParams());
Expand Down

0 comments on commit d77c144

Please sign in to comment.