Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1d7c2d

Browse files
committed
Pass tests on JDK 19 through 24
By updating the list of known JDK versions with that range. Also adds the javaVersion string to the test error message for ease of diagnosis.
1 parent 695bea8 commit a1d7c2d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/AbstractSymbolResolutionTest.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ protected enum TestJdk {
6666
JDK15(15),
6767
JDK16(16),
6868
JDK17(17),
69-
JDK18(18);
69+
JDK18(18),
70+
JDK19(19),
71+
JDK20(20),
72+
JDK21(21),
73+
JDK22(22),
74+
JDK23(23),
75+
JDK24(24);
7076

7177
private final Integer major;
7278

@@ -116,9 +122,21 @@ public static TestJdk getCurrentHostJdk() {
116122
return JDK17;
117123
} else if ("18".equals(javaVersion) || javaVersion.startsWith("18.")) {
118124
return JDK18;
125+
} else if ("19".equals(javaVersion) || javaVersion.startsWith("19.")) {
126+
return JDK19;
127+
} else if ("20".equals(javaVersion) || javaVersion.startsWith("20.")) {
128+
return JDK20;
129+
} else if ("21".equals(javaVersion) || javaVersion.startsWith("21.")) {
130+
return JDK21;
131+
} else if ("22".equals(javaVersion) || javaVersion.startsWith("22.")) {
132+
return JDK22;
133+
} else if ("23".equals(javaVersion) || javaVersion.startsWith("23.")) {
134+
return JDK23;
135+
} else if ("24".equals(javaVersion) || javaVersion.startsWith("24.")) {
136+
return JDK24;
119137
}
120138

121-
throw new IllegalStateException("Unable to determine the current version of java running");
139+
throw new IllegalStateException("Unable to determine the current version of java running from: " + javaVersion);
122140
}
123141

124142
/**

0 commit comments

Comments
 (0)