Skip to content

Commit

Permalink
Simplify FunctionalInterfaceNode.toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed May 19, 2024
1 parent a3c9036 commit d45075c
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.TreeUtils;

/**
Expand Down Expand Up @@ -55,14 +54,7 @@ public <R, P> R accept(NodeVisitor<R, P> visitor, P p) {

@Override
public String toString() {
if (tree instanceof LambdaExpressionTree) {
return "FunctionalInterfaceNode:" + ((LambdaExpressionTree) tree).getBodyKind();
} else if (tree instanceof MemberReferenceTree) {
return "FunctionalInterfaceNode:" + ((MemberReferenceTree) tree).getName();
} else {
// This should never happen.
throw new BugInCF("Invalid tree in FunctionalInterfaceNode");
}
return tree.toString();
}

@Override
Expand Down

0 comments on commit d45075c

Please sign in to comment.