Skip to content

Commit

Permalink
Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrprananta authored and rickie committed Apr 21, 2023
1 parent 974c8b6 commit ff71c21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ T after(Optional<T> o1, Optional<T> o2) {

/**
* Prefer {@link Optional#orElseGet(Supplier)} over {@link Optional#orElse(Object)} if the given
* value is not a compile-time constant.
* value is a method invocation with two or more arguments.
*/
// XXX: Extend rule to all method invocations (with less than 2 arguments).
static final class OrElseToOrElseGet<T> {
@BeforeTemplate
T before(Optional<T> o, @Matches(IsMethodInvocationWithTwoOrMoreArgs.class) T value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ IsMethodInvocationWithTwoOrMoreArgsTest.MatcherTestChecker.class, getClass())
.doTest();
}

/** A {@link BugChecker} that simply delegates to {@link IsCharacter}. */
/** A {@link BugChecker} that simply delegates to {@link IsMethodInvocationWithTwoOrMoreArgs}. */
@BugPattern(
summary = "Flags expressions matched by `IsMethodInvocationWithTwoOrMoreArgs`",
severity = ERROR)
Expand Down

0 comments on commit ff71c21

Please sign in to comment.