Skip to content

Commit 21c612c

Browse files
committed
Issue #403: upgrade to checkstyle 10.0; drop java 1.8 support
1 parent 962df96 commit 21c612c

File tree

7 files changed

+13
-18
lines changed

7 files changed

+13
-18
lines changed

.github/workflows/sonar-checkstyle-workflows.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ on:
77
pull_request:
88

99
jobs:
10-
mvn-install-java-8:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up JDK 8
15-
uses: actions/setup-java@v1
16-
with:
17-
java-version: 8
18-
- name: install
19-
run: "./.ci/ci.sh install"
20-
2110
mvn-install-java-11:
2211
runs-on: ubuntu-latest
2312
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ target/
1515
.project
1616
.settings
1717

18+
# ---- VSCode
19+
.vscode/
20+
1821
# ---- Mac OS X
1922
.DS_Store?
2023
Icon?

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Compatibility matrix from checkstyle team:
2121

2222
| Checkstyle Plugin | Sonar min | Sonar max | Checkstyle | Jdk |
2323
|-------------------|-----------|-----------|------------|-----|
24+
| 10.0 | 8.9 | 8.9+ | 10.0 | 11 |
2425
| 9.3 | 8.9 | 8.9+ | 9.3 | 1.8 |
2526
| 9.2.1 | 8.9 | 8.9+ | 9.2.1 | 1.8 |
2627
| 9.2 | 8.9 | 8.9+ | 9.2 | 1.8 |

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.github.checkstyle</groupId>
66
<artifactId>checkstyle-sonar-plugin</artifactId>
7-
<version>9.4-SNAPSHOT</version>
7+
<version>10.0-SNAPSHOT</version>
88
<packaging>sonar-plugin</packaging>
99

1010
<name>Checkstyle SonarQube Plugin</name>
@@ -93,7 +93,7 @@
9393
</ciManagement>
9494

9595
<properties>
96-
<checkstyle.version>9.3</checkstyle.version>
96+
<checkstyle.version>10.0</checkstyle.version>
9797
<sonar.version>8.9.0.43852</sonar.version>
9898
<sonar-java.version>7.2.0.26923</sonar-java.version>
9999
<maven.checkstyle.plugin.version>3.1.2</maven.checkstyle.plugin.version>
@@ -103,7 +103,7 @@
103103
8.35
104104
</maven.sevntu.checkstyle.plugin.checkstyle.version>
105105
<maven.jacoco.plugin.version>0.8.5</maven.jacoco.plugin.version>
106-
<java.version>1.8</java.version>
106+
<java.version>11</java.version>
107107
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
108108
<!-- we disable ITs by default as it need download of 200MB sonar application jar -->
109109
<skipITs>true</skipITs>

src/it/java/org/checkstyle/plugins/sonar/RunPluginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ private static void executeBuildWithCommonProperties(Build<?> build, boolean bui
154154

155155
private static void assertNoDifferences() {
156156
try {
157-
final String differences = new String(Files
158-
.readAllBytes(new File(litsDifferencesPath()).toPath()), UTF_8);
157+
final String differences = Files
158+
.readString(new File(litsDifferencesPath()).toPath(), UTF_8);
159159

160160
Assertions.assertThat(differences)
161161
.isEmpty();

src/test/java/org/sonar/plugins/checkstyle/CheckstyleConstantsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import java.lang.reflect.Constructor;
2525

26+
import org.eclipse.jdt.core.dom.Modifier;
2627
import org.junit.Test;
2728

2829
public class CheckstyleConstantsTest {
@@ -31,7 +32,7 @@ public class CheckstyleConstantsTest {
3132
public void privateConstructor() throws ReflectiveOperationException {
3233
final Constructor<CheckstyleConstants> constructor = CheckstyleConstants.class
3334
.getDeclaredConstructor();
34-
assertThat(constructor.isAccessible()).isFalse();
35+
assertThat(Modifier.isPrivate(constructor.getModifiers())).isTrue();
3536
constructor.setAccessible(true);
3637
constructor.newInstance();
3738
}

src/test/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtilsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import java.lang.reflect.Constructor;
2525

26+
import org.eclipse.jdt.core.dom.Modifier;
2627
import org.junit.Assert;
2728
import org.junit.Test;
2829
import org.sonar.api.rules.RulePriority;
@@ -72,7 +73,7 @@ public void privateConstructor() throws ReflectiveOperationException {
7273
final Constructor<CheckstyleSeverityUtils> constructor = CheckstyleSeverityUtils.class
7374
.getDeclaredConstructor();
7475

75-
assertThat(constructor.isAccessible()).isFalse();
76+
assertThat(Modifier.isPrivate(constructor.getModifiers())).isTrue();
7677
constructor.setAccessible(true);
7778
constructor.newInstance();
7879
}

0 commit comments

Comments
 (0)