mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
8250625: Compiler implementation of Pattern Matching for instanceof (Final)
Reviewed-by: vromero
This commit is contained in:
parent
60e4aca846
commit
18bc95ba51
86 changed files with 230 additions and 312 deletions
|
@ -105,20 +105,20 @@ public class TestBindingVariable extends JavacTestingAbstractProcessor implement
|
|||
}
|
||||
@Override
|
||||
public Void visitBindingPattern(BindingPatternTree node, Void p) {
|
||||
handleCurrentTreeAsBindingVar();
|
||||
handleTreeAsBindingVar(new TreePath(getCurrentPath(), node.getVariable()));
|
||||
return super.visitBindingPattern(node, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitIdentifier(IdentifierTree node, Void p) {
|
||||
if (node.getName().contentEquals("bindingVar")) {
|
||||
handleCurrentTreeAsBindingVar();
|
||||
handleTreeAsBindingVar(getCurrentPath());
|
||||
}
|
||||
return super.visitIdentifier(node, p);
|
||||
}
|
||||
|
||||
private void handleCurrentTreeAsBindingVar() {
|
||||
Element element = trees.getElement(getCurrentPath());
|
||||
private void handleTreeAsBindingVar(TreePath tp) {
|
||||
Element element = trees.getElement(tp);
|
||||
|
||||
System.out.println("Name: " + element.getSimpleName() +
|
||||
"\tKind: " + element.getKind());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue