Skip to content

Commit 32a08dd

Browse files
author
Vincent Potucek
committed
rewrite-maven-plugin: Introduce OpenRewrite by Moderne (RemoveUnusedPrivateMethods)
1 parent 6019307 commit 32a08dd

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,56 @@ under the License.</licenseText>
796796
</excludes>
797797
</configuration>
798798
</plugin>
799+
<plugin>
800+
<groupId>org.openrewrite.maven</groupId>
801+
<artifactId>rewrite-maven-plugin</artifactId>
802+
<version>6.8.0</version>
803+
<configuration>
804+
<activeRecipes>
805+
<!-- BestPractices -->
806+
<!-- <recipe>org.openrewrite.java.recipes.JavaRecipeBestPractices</recipe> -->
807+
<!-- <recipe>org.openrewrite.java.recipes.RecipeNullabilityBestPractices</recipe> -->
808+
<!-- <recipe>org.openrewrite.java.recipes.RecipeTestingBestPractices</recipe> -->
809+
<!-- testing -->
810+
<!-- <recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe> -->
811+
<!-- <recipe>org.openrewrite.java.testing.assertj.SimplifyAssertJAssertion</recipe> -->
812+
<!-- <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe> -->
813+
<!-- staticanalysis -->
814+
<!-- <recipe>org.openrewrite.staticanalysis.CodeCleanup</recipe> -->
815+
<!-- <recipe>org.openrewrite.staticanalysis.CommonStaticAnalysis</recipe> -->
816+
<!-- <recipe>org.openrewrite.staticanalysis.FinalizeMethodArguments</recipe> -->
817+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedLocalVariables</recipe> -->
818+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateFields</recipe> -->
819+
<recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods</recipe>
820+
</activeRecipes>
821+
<exportDatatables>true</exportDatatables>
822+
<failOnDryRunResults>true</failOnDryRunResults>
823+
</configuration>
824+
<dependencies>
825+
<dependency>
826+
<groupId>org.openrewrite.recipe</groupId>
827+
<artifactId>rewrite-static-analysis</artifactId>
828+
<version>2.9.0</version>
829+
</dependency>
830+
</dependencies>
831+
<executions>
832+
<execution>
833+
<id>rewrite-maven-plugin</id>
834+
<goals>
835+
<goal>dryRun</goal>
836+
</goals>
837+
<phase>verify</phase>
838+
</execution>
839+
</executions>
840+
</plugin>
799841
</plugins>
800842
</pluginManagement>
801843
<plugins>
844+
<!-- undo-->
845+
<plugin>
846+
<groupId>org.openrewrite.maven</groupId>
847+
<artifactId>rewrite-maven-plugin</artifactId>
848+
</plugin>
802849
<plugin>
803850
<groupId>io.github.olamy.maven.plugins</groupId>
804851
<artifactId>jacoco-aggregator-maven-plugin</artifactId>
@@ -1159,5 +1206,19 @@ under the License.</licenseText>
11591206
</plugins>
11601207
</build>
11611208
</profile>
1209+
<profile>
1210+
<id>rewrite</id>
1211+
<activation>
1212+
<activeByDefault>true</activeByDefault>
1213+
</activation>
1214+
<build>
1215+
<plugins>
1216+
<plugin>
1217+
<groupId>org.openrewrite.maven</groupId>
1218+
<artifactId>rewrite-maven-plugin</artifactId>
1219+
</plugin>
1220+
</plugins>
1221+
</build>
1222+
</profile>
11621223
</profiles>
11631224
</project>

src/mdo/java/WrapperList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public T remove(int index) {
105105
}
106106
}
107107

108-
private Object writeReplace() throws ObjectStreamException {
108+
Object writeReplace() throws ObjectStreamException {
109109
return new ArrayList<T>(this);
110110
}
111111
}

src/mdo/java/WrapperProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public void storeToXML(OutputStream os, String comment, String encoding) throws
372372
}
373373

374374

375-
private Object writeReplace() throws java.io.ObjectStreamException {
375+
Object writeReplace() throws java.io.ObjectStreamException {
376376
Properties props = new Properties();
377377
props.putAll(getter.get());
378378
return props;

0 commit comments

Comments
 (0)