Skip to content

Commit af2ad59

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

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
@@ -807,9 +807,56 @@ under the License.</licenseText>
807807
</dependency>
808808
</dependencies>
809809
</plugin>
810+
<plugin>
811+
<groupId>org.openrewrite.maven</groupId>
812+
<artifactId>rewrite-maven-plugin</artifactId>
813+
<version>6.8.0</version>
814+
<configuration>
815+
<activeRecipes>
816+
<!-- BestPractices -->
817+
<!-- <recipe>org.openrewrite.java.recipes.JavaRecipeBestPractices</recipe> -->
818+
<!-- <recipe>org.openrewrite.java.recipes.RecipeNullabilityBestPractices</recipe> -->
819+
<!-- <recipe>org.openrewrite.java.recipes.RecipeTestingBestPractices</recipe> -->
820+
<!-- testing -->
821+
<!-- <recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe> -->
822+
<!-- <recipe>org.openrewrite.java.testing.assertj.SimplifyAssertJAssertion</recipe> -->
823+
<!-- <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe> -->
824+
<!-- staticanalysis -->
825+
<!-- <recipe>org.openrewrite.staticanalysis.CodeCleanup</recipe> -->
826+
<!-- <recipe>org.openrewrite.staticanalysis.CommonStaticAnalysis</recipe> -->
827+
<!-- <recipe>org.openrewrite.staticanalysis.FinalizeMethodArguments</recipe> -->
828+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedLocalVariables</recipe> -->
829+
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateFields</recipe> -->
830+
<recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods</recipe>
831+
</activeRecipes>
832+
<exportDatatables>true</exportDatatables>
833+
<failOnDryRunResults>true</failOnDryRunResults>
834+
</configuration>
835+
<dependencies>
836+
<dependency>
837+
<groupId>org.openrewrite.recipe</groupId>
838+
<artifactId>rewrite-static-analysis</artifactId>
839+
<version>2.9.0</version>
840+
</dependency>
841+
</dependencies>
842+
<executions>
843+
<execution>
844+
<id>rewrite-maven-plugin</id>
845+
<goals>
846+
<goal>dryRun</goal>
847+
</goals>
848+
<phase>verify</phase>
849+
</execution>
850+
</executions>
851+
</plugin>
810852
</plugins>
811853
</pluginManagement>
812854
<plugins>
855+
<!-- undo-->
856+
<plugin>
857+
<groupId>org.openrewrite.maven</groupId>
858+
<artifactId>rewrite-maven-plugin</artifactId>
859+
</plugin>
813860
<plugin>
814861
<groupId>io.github.olamy.maven.plugins</groupId>
815862
<artifactId>jacoco-aggregator-maven-plugin</artifactId>
@@ -1170,5 +1217,19 @@ under the License.</licenseText>
11701217
</plugins>
11711218
</build>
11721219
</profile>
1220+
<profile>
1221+
<id>rewrite</id>
1222+
<activation>
1223+
<activeByDefault>true</activeByDefault>
1224+
</activation>
1225+
<build>
1226+
<plugins>
1227+
<plugin>
1228+
<groupId>org.openrewrite.maven</groupId>
1229+
<artifactId>rewrite-maven-plugin</artifactId>
1230+
</plugin>
1231+
</plugins>
1232+
</build>
1233+
</profile>
11731234
</profiles>
11741235
</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)