From ba721ebed8f2c2f2c9314d04782d4d066b6e82dd Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Sun, 28 Jan 2024 14:38:59 +0100 Subject: [PATCH] Introduce `error-prone-experimental` module --- .../bugpatterns/IsInstanceLambdaUsage.java | 2 +- error-prone-experimental/README.md | 6 ++ error-prone-experimental/pom.xml | 91 +++++++++++++++++++ .../bugpatterns/MethodReferenceUsage.java | 2 +- .../bugpatterns/MethodReferenceUsageTest.java | 0 pom.xml | 11 +++ 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 error-prone-experimental/README.md create mode 100644 error-prone-experimental/pom.xml rename {error-prone-contrib => error-prone-experimental}/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java (99%) rename {error-prone-contrib => error-prone-experimental}/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java (100%) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java index 21ff02436a3..0597d03deda 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/IsInstanceLambdaUsage.java @@ -24,7 +24,7 @@ * A {@link BugChecker} that flags lambda expressions that can be replaced with a method reference * of the form {@code T.class::isInstance}. * - * @see MethodReferenceUsage + *

See the `MethodReferenceUsage` check in the `error-prone-experimental` module. */ // XXX: Consider folding this logic into the `MethodReferenceUsage` check. @AutoService(BugChecker.class) diff --git a/error-prone-experimental/README.md b/error-prone-experimental/README.md new file mode 100644 index 00000000000..7a5f6f0d7bc --- /dev/null +++ b/error-prone-experimental/README.md @@ -0,0 +1,6 @@ +# Experimental Error Prone checks + +This module contains Error Prone checks that are currently under development or +evaluation. These checks may be works-in-progress or have uncertain impacts on +code. Having this module allows for controlled experimentation and refinement +before integration into production environments. diff --git a/error-prone-experimental/pom.xml b/error-prone-experimental/pom.xml new file mode 100644 index 00000000000..12f3b2fffe7 --- /dev/null +++ b/error-prone-experimental/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + + tech.picnic.error-prone-support + error-prone-support + 0.14.1-SNAPSHOT + + + error-prone-experimental + + Picnic :: Error Prone Support :: Experimental + Experimental Error Prone checks. + https://error-prone.picnic.tech + + + + ${groupId.error-prone} + error_prone_annotation + provided + + + ${groupId.error-prone} + error_prone_annotations + provided + + + ${groupId.error-prone} + error_prone_check_api + provided + + + ${groupId.error-prone} + error_prone_core + provided + + + ${groupId.error-prone} + error_prone_test_helpers + provided + + + ${project.groupId} + error-prone-utils + provided + + + com.google.auto.service + auto-service-annotations + provided + + + com.google.guava + guava + provided + + + io.projectreactor + reactor-core + test + + + org.assertj + assertj-core + test + + + org.jspecify + jspecify + provided + + + org.junit.jupiter + junit-jupiter-api + provided + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + provided + + + diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java b/error-prone-experimental/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java similarity index 99% rename from error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java rename to error-prone-experimental/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java index 4123d02f1eb..1e184010e79 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java +++ b/error-prone-experimental/src/main/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsage.java @@ -38,7 +38,7 @@ /** * A {@link BugChecker} that flags lambda expressions that can be replaced with method references. * - * @see IsInstanceLambdaUsage + *

See the `IsInstanceLambdaUsage` check in the `error-prone-contrib` module. */ // XXX: Other custom expressions we could rewrite: // - `a -> "str" + a` to `"str"::concat`. But only if `str` is provably non-null. diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java b/error-prone-experimental/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java similarity index 100% rename from error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java rename to error-prone-experimental/src/test/java/tech/picnic/errorprone/bugpatterns/MethodReferenceUsageTest.java diff --git a/pom.xml b/pom.xml index 41d7a272651..3100cab22b0 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ documentation-support error-prone-contrib + error-prone-experimental error-prone-utils refaster-compiler refaster-runner @@ -256,6 +257,11 @@ error-prone-contrib ${project.version} + + ${project.groupId} + error-prone-experimental + ${project.version} + ${project.groupId} error-prone-utils @@ -1607,6 +1613,11 @@ error-prone-contrib ${project.version} + + ${project.groupId} + error-prone-experimental + ${project.version} + ${project.groupId} refaster-runner