Skip to content

Commit

Permalink
Disable expensive LambdaMethodReference by default (#2999)
Browse files Browse the repository at this point in the history
Disable expensive LambdaMethodReference by default
  • Loading branch information
carterkozak authored Jan 17, 2025
1 parent 055aef8 commit af73326
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@BugPattern(
link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks",
linkType = BugPattern.LinkType.CUSTOM,
severity = SeverityLevel.WARNING,
severity = SeverityLevel.SUGGESTION,
summary = "Lambda should be a method reference")
@SuppressWarnings("checkstyle:CyclomaticComplexity")
public final class LambdaMethodReference extends BugChecker implements BugChecker.LambdaExpressionTreeMatcher {
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2999.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Disable expensive LambdaMethodReference by default
links:
- https://github.com/palantir/gradle-baseline/pull/2999
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public abstract class BaselineErrorProneExtension {
"ImplicitPublicBuilderConstructor",
"JavaTimeDefaultTimeZone",
"JavaTimeSystemDefaultTimeZone",
"LambdaMethodReference",
"LoggerEnclosingClass",
"LogsafeArgName",
"ObjectsHashCodeUnnecessaryVarargs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ private static void configureErrorProneOptions(ErrorProneOptions errorProneOptio
// https://github.com/google/error-prone/issues/4544
"DistinctVarargsChecker",
"InlineMeSuggester",
// LambdaMethodReference is incredibly expensive, see #2997. We leave it
// here to employ as a cleanup, but don't execute it in most compilations.
"LambdaMethodReference",
// We often use javadoc comments without javadoc parameter information.
"NotJavadoc",
"PreferImmutableStreamExCollections",
Expand Down

0 comments on commit af73326

Please sign in to comment.