From f3360c6ffc3aba6d2a551453dd984cda820c8965 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 21ff02436a..0597d03ded 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 0000000000..7a5f6f0d7b --- /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 0000000000..12f3b2fffe --- /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 4123d02f1e..1e184010e7 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 12ff71fe60..426ecf8d16 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 @@ -1600,6 +1606,11 @@ error-prone-contrib ${project.version} + + ${project.groupId} + error-prone-experimental + ${project.version} + ${project.groupId} refaster-runner