Skip to content

Commit 05420c3

Browse files
committed
Upgrade to CleanThat 2.16. Include management of JDK17 Sealed classes for Unnecessaryimports
1 parent 609ac5f commit 05420c3

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ dependencies {
7070

7171
// GLUE CODE (alphabetic order please)
7272
// cleanthat
73-
String VER_CLEANTHAT='2.13'
73+
String VER_CLEANTHAT='2.16'
7474
cleanthatCompileOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
7575
compatCleanthat2Dot1CompileAndTestOnly "io.github.solven-eu.cleanthat:java:$VER_CLEANTHAT"
7676
// diktat

lib/src/main/java/com/diffplug/spotless/java/CleanthatJavaStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public final class CleanthatJavaStep {
4040
private static final String MAVEN_COORDINATE = "io.github.solven-eu.cleanthat:java";
4141

4242
// CleanThat changelog is available at https://github.com/solven-eu/cleanthat/blob/master/CHANGES.MD
43-
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(11, "2.13");
43+
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(11, "2.16");
4444

4545
// prevent direct instantiation
4646
private CleanthatJavaStep() {}

testlib/src/main/resources/java/removeunusedimports/SealedClassTestsFormatted.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
1414
import static org.junit.jupiter.api.Assertions.fail;
1515

1616
import org.junit.jupiter.api.Test;
17-
1817
class SealedClassTests extends AbstractJupiterTestEngineTests {
1918

2019
@Test

testlib/src/test/java/com/diffplug/spotless/java/RemoveUnusedImportsStep_withCleanthatJavaparserTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ void behavior() throws Exception {
3333
.testResource("java/removeunusedimports/JavaCodeWithPackageUnformatted.test", "java/removeunusedimports/JavaCodeWithPackageFormatted.test")
3434
.testResource("java/removeunusedimports/Jdk17TextBlockUnformatted.test", "java/removeunusedimports/Jdk17TextBlockFormatted.test")
3535
.testResource("java/removeunusedimports/RevelcUnformatted.test", "java/removeunusedimports/RevelcFormatted.test")
36-
// Sealed classes are introduced with JDK15: This syntax is not supported by javaParser: such files are not trimmed from unused imports (for now)
37-
.testResource("java/removeunusedimports/SealedClassTestsUnformatted.test", "java/removeunusedimports/SealedClassTestsUnformatted.test");
36+
.testResource("java/removeunusedimports/SealedClassTestsUnformatted.test", "java/removeunusedimports/SealedClassTestsFormatted.test");
3837
}
3938

4039
@Test

0 commit comments

Comments
 (0)