Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Feb 4, 2024
1 parent ba721eb commit eb21d65
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
/**
* A {@link BugChecker} that flags lambda expressions that can be replaced with a method reference
* of the form {@code T.class::isInstance}.
*
* <p>See the `MethodReferenceUsage` check in the `error-prone-experimental` module.
*/
// XXX: Consider folding this logic into the `MethodReferenceUsage` check.
// XXX: Consider folding this logic into the `MethodReferenceUsage` check of the
// `error-prone-experimental` module.
@AutoService(BugChecker.class)
@BugPattern(
summary = "Prefer `Class::isInstance` method reference over equivalent lambda expression",
Expand Down
2 changes: 1 addition & 1 deletion error-prone-experimental/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +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
evaluation. These checks may be works-in-progress or have uncertain impact on
code. Having this module allows for controlled experimentation and refinement
before integration into production environments.
30 changes: 0 additions & 30 deletions error-prone-experimental/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,11 @@
<artifactId>error_prone_annotation</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_check_api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_test_helpers</artifactId>
Expand All @@ -55,21 +45,6 @@
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand All @@ -82,10 +57,5 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.picnic.errorprone.bugpatterns;
package tech.picnic.errorprone.experimental.bugpatterns;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.errorprone.BugPattern.LinkType.CUSTOM;
Expand Down Expand Up @@ -37,8 +37,6 @@

/**
* A {@link BugChecker} that flags lambda expressions that can be replaced with method references.
*
* <p>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.
Expand All @@ -54,7 +52,8 @@
// Palantir's `LambdaMethodReference` check seems to suffer a similar issue at this time.
// XXX: Expressions of the form `i -> SomeType.class.isInstance(i)` are not replaced; fix that using
// a suitable generalization.
// XXX: Consider folding the `IsInstanceLambdaUsage` check into this class.
// XXX: Consider folding the `IsInstanceLambdaUsage` check of the `error-prone-contrib` module into
// this class.
@AutoService(BugChecker.class)
@BugPattern(
summary = "Prefer method references over lambda expressions",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.picnic.errorprone.bugpatterns;
package tech.picnic.errorprone.experimental.bugpatterns;

import com.google.errorprone.BugCheckerRefactoringTestHelper;
import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode;
Expand Down

0 comments on commit eb21d65

Please sign in to comment.