From f8b1039bcfdc5f7a99089aa20da6f8898c80fc9d Mon Sep 17 00:00:00 2001 From: Vincent Potucek Date: Mon, 11 Aug 2025 17:57:45 +0200 Subject: [PATCH] Add `rewrite` support for `UnnecessaryParentheses` --- pom.xml | 1221 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 635 insertions(+), 586 deletions(-) diff --git a/pom.xml b/pom.xml index 7169d0b84724..d88bfedc0c89 100644 --- a/pom.xml +++ b/pom.xml @@ -3,602 +3,651 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - 4.0.0 - com.google.guava - guava-parent - 999.0.0-HEAD-jre-SNAPSHOT - pom - Guava Maven Parent - Parent for guava artifacts - https://github.com/google/guava - - - ${java.specification.version} - - %regex[.*.class] - 1.4.4 - 1.0.0 - 2.36.0 - 3.0.0 - 2025-01-02T00:00:00Z - UTF-8 - - - --add-opens java.base/java.lang=ALL-UNNAMED - --add-opens java.base/java.util=ALL-UNNAMED - --add-opens java.base/sun.security.jca=ALL-UNNAMED - - - integration - standard-jvm - jre - 999.0.0-HEAD-android-SNAPSHOT - android - android - - - GitHub Issues - https://github.com/google/guava/issues - - 2010 - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - scm:git:https://github.com/google/guava.git - scm:git:git@github.com:google/guava.git + 4.0.0 + com.google.guava + guava-parent + 999.0.0-HEAD-jre-SNAPSHOT + pom + Guava Maven Parent + Parent for guava artifacts https://github.com/google/guava - - - - kevinb9n - Kevin Bourrillion - kevinb@google.com - Google - http://www.google.com - - owner - developer - - -8 - - - - GitHub Actions - https://github.com/google/guava/actions - - - guava - guava-bom - guava-gwt - guava-testlib - guava-tests - - - - src - test - - - .. - - LICENSE - - META-INF - - - - - test - - **/*.java - - - - - - maven-enforcer-plugin - - - enforce-versions - - enforce - - - - - 3.0.5 - - - 1.8.0 - - - - - - - - - - - maven-antrun-plugin - 1.6 - - - maven-compiler-plugin - 3.13.0 - - 1.8 - 1.8 - UTF-8 - true - - - -XDcompilePolicy=simple - --should-stop=ifError=FLOW + 2010 + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + kevinb9n + Kevin Bourrillion + kevinb@google.com + Google + http://www.google.com + + owner + developer + + -8 + + + + guava + guava-bom + guava-gwt + guava-testlib + guava-tests + + + scm:git:https://github.com/google/guava.git + scm:git:git@github.com:google/guava.git + https://github.com/google/guava + + + GitHub Issues + https://github.com/google/guava/issues + + + GitHub Actions + https://github.com/google/guava/actions + + + + sonatype-nexus-snapshots + https://central.sonatype.com/repository/maven-snapshots/ + + + guava-site + Guava Documentation Site + scp://dummy.server/dontinstall/usestaging + + + + + ${java.specification.version} + + %regex[.*.class] + 1.4.4 + 1.0.0 + 2.36.0 + 3.0.0 + 2025-01-02T00:00:00Z + UTF-8 + - - -Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF -Xep:Java8ApiChecker:ERROR - - - -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED - -Xlint:-removal,-options - - - - com.google.errorprone - error_prone_core - 2.36.0 - - - - true - - - - default-compile - - 1.8 - 1.8 - - module-info.java - - - - -sourcepath - doesnotexist - - - - - default-testCompile - - - -Xlint:-removal - - - - - - - maven-dependency-plugin - 3.1.1 - - - maven-enforcer-plugin - 3.0.0-M3 - - - maven-install-plugin - 3.1.3 - - - maven-jar-plugin - 3.4.2 - - - - - /module-info.class - - META-INF/versions/9/com/**/*.class - - - - true - - - - + We could consider arranging things so that only the tests we know need this would get + the add-opens. Right now that doesn't seem worth the effort, though. + --> + + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/sun.security.jca=ALL-UNNAMED + + integration + standard-jvm + jre + 999.0.0-HEAD-android-SNAPSHOT + android + android + + + - org.codehaus.plexus - plexus-io - - 3.5.1 + org.jspecify + jspecify + ${jspecify.version} - - - - maven-javadoc-plugin - 3.11.2 - - true - true - UTF-8 - UTF-8 - UTF-8 - - -XDignore.symbol.file - -Xdoclint:-html - - 8 - - - - attach-docs - jar - - - - - maven-resources-plugin - 3.3.1 - - - maven-source-plugin - 3.3.1 - - - attach-sources - - jar-no-fork - - - - - org.codehaus.plexus - plexus-io - - 3.5.1 + com.google.errorprone + error_prone_annotations + ${errorprone.version} - - - - maven-surefire-plugin - 3.3.1 - - - ${surefire.toolchain.version} - - - ${test.include} - - - - - %regex[.*PackageSanityTests.*.class] - - %regex[.*Tester.class] - - %regex[.*[$]\d+.class] - - true - alphabetical - - - -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.args} ${test.add.opens} - - - - maven-toolchains-plugin - 3.2.0 - - - - toolchain - - - - - - - 24 - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.23 - - org.ow2.asm - asm - 9.6 + com.google.j2objc + j2objc-annotations + ${j2objc.version} - - - - com.google.common.base.IgnoreJRERequirement - com.google.common.cache.IgnoreJRERequirement - com.google.common.collect.IgnoreJRERequirement - com.google.common.collect.testing.IgnoreJRERequirement - com.google.common.collect.testing.testers.IgnoreJRERequirement - com.google.common.hash.IgnoreJRERequirement - com.google.common.io.IgnoreJRERequirement - com.google.common.math.IgnoreJRERequirement - com.google.common.primitives.IgnoreJRERequirement - com.google.common.reflect.IgnoreJRERequirement - com.google.common.testing.IgnoreJRERequirement - com.google.common.util.concurrent.IgnoreJRERequirement - - true - - org.codehaus.mojo.signature - java18 - 1.0 - - - - - check-java-version-compatibility - test - - check - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.4.0 - - - org.mvnsearch - toolchains-maven-plugin - 4.5.0 - - - download-24-and-surefire-version - - toolchain - - - - - 24 - temurin - - - ${surefire.toolchain.version} - temurin - - - - - - - - - - - - sonatype-nexus-snapshots - https://central.sonatype.com/repository/maven-snapshots/ - - - guava-site - Guava Documentation Site - scp://dummy.server/dontinstall/usestaging - - - - - - org.jspecify - jspecify - ${jspecify.version} - - - com.google.errorprone - error_prone_annotations - ${errorprone.version} - - - com.google.j2objc - j2objc-annotations - ${j2objc.version} - - - - - - - sonatype-oss-release - - - - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.central - central-publishing-maven-plugin - 0.8.0 - true - - central - - - - - - - suppress-open-jre-modules-for-toolchain-1.8 - - - surefire.toolchain.version - - 1.8 - - - - - - - - suppress-open-jre-modules-for-toolchain-8 - - - surefire.toolchain.version - - 8 - - - - - - - - - print-java-11-home - + + + + + src + test + + + .. + + LICENSE + + META-INF + + + + + test + + **/*.java + + + - - org.mvnsearch - toolchains-maven-plugin - - - download-11 - initialize - - toolchain - - - - - 11 - temurin - - - - - - - - maven-toolchains-plugin - - - select-java-11 - initialize - - toolchain - - - - - - - 11 - - - - - - com.diamondq.maven - javahome-resolver-maven-plugin - 1.0.2 - - - resolve-java-11 - initialize - - resolve - - - - - - org.codehaus.mojo - exec-maven-plugin - 3.5.0 - - - print-java-11-home - initialize - - exec - - - echo - - ${javaHome} - - ${project.build.directory}/java_11_home - - - - + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-versions + + enforce + + + + + 3.0.5 + + + 1.8.0 + + + + + + + + org.openrewrite.maven + rewrite-maven-plugin + - - - + + + + org.openrewrite.maven + rewrite-maven-plugin + 6.15.0 + + + org.openrewrite.staticanalysis.UnnecessaryParentheses + + + + + **AbstractCompositeHashFunction.java + **AbstractLoadingCache.java + **FuturesTest.java + **SerializableTesterTest.java + **guava-bom/pom.xml + **module-info.java + + true + true + + + + verify + + dryRun + + + + + + org.openrewrite.recipe + rewrite-static-analysis + 2.14.0 + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.6 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 1.8 + 1.8 + UTF-8 + true + + + -XDcompilePolicy=simple + --should-stop=ifError=FLOW + + + -Xplugin:ErrorProne -Xep:NullArgumentForNonNullParameter:OFF -Xep:Java8ApiChecker:ERROR + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + -Xlint:-removal,-options + + + + com.google.errorprone + error_prone_core + 2.36.0 + + + + true + + + + default-compile + + 1.8 + 1.8 + + module-info.java + + + + -sourcepath + doesnotexist + + + + + default-testCompile + + + -Xlint:-removal + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + org.apache.maven.plugins + maven-install-plugin + 3.1.3 + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.2 + + + + + /module-info.class + + META-INF/versions/9/com/**/*.class + + + + true + + + + + + org.codehaus.plexus + plexus-io + + 3.5.1 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.11.2 + + true + true + UTF-8 + UTF-8 + UTF-8 + + -XDignore.symbol.file + -Xdoclint:-html + + 8 + + + + attach-docs + + jar + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + + jar-no-fork + + + + + + org.codehaus.plexus + plexus-io + + 3.5.1 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.3.1 + + + ${surefire.toolchain.version} + + + ${test.include} + + + + + %regex[.*PackageSanityTests.*.class] + + %regex[.*Tester.class] + + %regex[.*[$]\d+.class] + + true + alphabetical + + + -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.opens} + + + + org.apache.maven.plugins + maven-toolchains-plugin + 3.2.0 + + + + toolchain + + + + + + + 24 + + + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + 1.23 + + + org.ow2.asm + asm + 9.6 + + + + + com.google.common.base.IgnoreJRERequirement + com.google.common.cache.IgnoreJRERequirement + com.google.common.collect.IgnoreJRERequirement + com.google.common.collect.testing.IgnoreJRERequirement + com.google.common.collect.testing.testers.IgnoreJRERequirement + com.google.common.hash.IgnoreJRERequirement + com.google.common.io.IgnoreJRERequirement + com.google.common.math.IgnoreJRERequirement + com.google.common.primitives.IgnoreJRERequirement + com.google.common.reflect.IgnoreJRERequirement + com.google.common.testing.IgnoreJRERequirement + com.google.common.util.concurrent.IgnoreJRERequirement + + true + + org.codehaus.mojo.signature + java18 + 1.0 + + + + + check-java-version-compatibility + test + + check + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + org.mvnsearch + toolchains-maven-plugin + 4.5.0 + + + + download-24-and-surefire-version + + toolchain + + + + + 24 + temurin + + + ${surefire.toolchain.version} + temurin + + + + + + + + + + + + sonatype-oss-release + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + + + + + + + suppress-open-jre-modules-for-toolchain-1.8 + + + surefire.toolchain.version + + 1.8 + + + + + suppress-open-jre-modules-for-toolchain-8 + + + surefire.toolchain.version + + 8 + + + + + + print-java-11-home + + + + org.mvnsearch + toolchains-maven-plugin + + + download-11 + initialize + + toolchain + + + + + 11 + temurin + + + + + + + + org.apache.maven.plugins + maven-toolchains-plugin + + + select-java-11 + initialize + + toolchain + + + + + + + 11 + + + + + + com.diamondq.maven + javahome-resolver-maven-plugin + 1.0.2 + + + resolve-java-11 + initialize + + resolve + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + + + print-java-11-home + initialize + + exec + + + echo + + ${javaHome} + + ${project.build.directory}/java_11_home + + + + + + + +