Skip to content

Commit 0618a8c

Browse files
authored
Merge pull request #499 from jborgers/master-fix-supported-java-versions
fix supported java versions up to 24-preview
2 parents b63605a + 24cb3cb commit 0618a8c

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

integration-test/src/test/java/com/sonar/it/java/suite/PmdIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void startSonar() {
4848
}
4949

5050
@ParameterizedTest
51-
@EnumSource(value = JavaVersion.class, mode = EnumSource.Mode.INCLUDE, names = {"JAVA_1_8", "JAVA_11", "JAVA_17", "JAVA_20"})
51+
@EnumSource(value = JavaVersion.class, mode = EnumSource.Mode.INCLUDE, names = {"JAVA_1_8", "JAVA_11", "JAVA_17", "JAVA_21", "JAVA_22"})
5252
void testPmdExtensionsWithDifferentJavaVersions(JavaVersion version) {
5353

5454
// given

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
<properties>
8585
<!-- use -Drevision=x.y.z to override in build -->
86-
<revision>4.0.0-SNAPSHOT</revision>
86+
<revision>4.0.1-SNAPSHOT</revision>
8787
<license.owner>SonarSource SA and others</license.owner>
8888
<license.mailto>mailto:jborgers AT jpinpoint DOT com; peter.paul.bakker AT stokpop DOT nl</license.mailto>
8989
<pmd.version>7.10.0</pmd.version>

sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdConstants.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ public final class PmdConstants {
4343
/**
4444
* Default value for property {@link #JAVA_SOURCE_VERSION}.
4545
*/
46-
public static final String JAVA_SOURCE_VERSION_DEFAULT_VALUE = "11";
46+
public static final String JAVA_SOURCE_VERSION_DEFAULT_VALUE = "24";
4747

4848
/**
49-
* Maximum supported value for property {@link #JAVA_SOURCE_VERSION}. For PMD 6 this is 20-preview.
49+
* Maximum supported value for property {@link #JAVA_SOURCE_VERSION}. For PMD 7 this is 24-preview.
5050
*/
51-
public static final String JAVA_SOURCE_MAXIMUM_SUPPORTED_VALUE = "20-preview";
51+
public static final String JAVA_SOURCE_MAXIMUM_SUPPORTED_VALUE = "24-preview";
5252

5353
/**
54-
* Minimum UNsupported value for property {@link #JAVA_SOURCE_VERSION}. For PMD 6 this is 21.
54+
* Minimum UNsupported value for property {@link #JAVA_SOURCE_VERSION}. For PMD 7 this is 25.
5555
*/
56-
public static final String JAVA_SOURCE_MINIMUM_UNSUPPORTED_VALUE = "21";
56+
public static final String JAVA_SOURCE_MINIMUM_UNSUPPORTED_VALUE = "25";
5757
/**
5858
* The Java Language key.
5959
*/

sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdTemplate.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ private static Map<String, String> prepareVersions() {
5454
versions.put("1.17", "17");
5555
versions.put("1.18", "18");
5656
versions.put("1.19", "19");
57-
versions.put("1.19-preview", "19-preview");
5857
versions.put("1.20", "20");
59-
versions.put("1.20-preview", "20-preview");
58+
versions.put("1.21", "21");
59+
versions.put("1.22", "22");
60+
versions.put("1.23", "23");
61+
versions.put("1.24", "24");
62+
versions.put("1.24-preview", "24-preview");
6063
return versions;
6164
}
6265

sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdConstantsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void checkDefinedKeys() {
3838
assertThat(PmdConstants.XPATH_EXPRESSION_PARAM).isEqualTo("xpath");
3939
assertThat(PmdConstants.XPATH_MESSAGE_PARAM).isEqualTo("message");
4040
assertThat(PmdConstants.JAVA_SOURCE_VERSION).isEqualTo("sonar.java.source");
41-
assertThat(PmdConstants.JAVA_SOURCE_VERSION_DEFAULT_VALUE).isEqualTo("11");
41+
assertThat(PmdConstants.JAVA_SOURCE_VERSION_DEFAULT_VALUE).isEqualTo("24");
4242
assertThat(PmdConstants.LANGUAGE_JAVA_KEY).isEqualTo("java");
4343
}
4444
}

0 commit comments

Comments
 (0)