Skip to content

Commit

Permalink
Simplify, improve coverge
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Aug 14, 2023
1 parent 70461d4 commit 4fb3656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.LambdaExpressionTree;
import com.sun.source.tree.LambdaExpressionTree.BodyKind;
import com.sun.source.tree.Tree.Kind;
import java.util.function.DoubleUnaryOperator;
import java.util.function.Function;
import java.util.function.IntUnaryOperator;
Expand Down Expand Up @@ -49,7 +48,6 @@ private static Matcher<ExpressionTree> isIdentityLambdaExpression() {
(tree, state) ->
tree.getBodyKind() == BodyKind.EXPRESSION
&& tree.getParameters().size() == 1
&& tree.getBody().getKind() == Kind.IDENTIFIER
&& ASTHelpers.getSymbol(tree.getParameters().get(0))
.equals(ASTHelpers.getSymbol(tree.getBody())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ void matches() {
" return (a, b) -> a;",
" }",
"",
" UnaryOperator<String> negative2() {",
" return a -> a + a;",
" }",
"",
" DoubleUnaryOperator positive1() {",
" // BUG: Diagnostic contains:",
" return DoubleUnaryOperator.identity();",
Expand Down

0 comments on commit 4fb3656

Please sign in to comment.