< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java

Print this page

        

@@ -488,10 +488,14 @@
                     return node.pos;
                 } else {
                     return getStartPos(node.vartype);
                 }
             }
+            case BINDINGPATTERN: {
+                JCBindingPattern node = (JCBindingPattern)tree;
+                return getStartPos(node.vartype);
+            }
             case ERRONEOUS: {
                 JCErroneous node = (JCErroneous)tree;
                 if (node.errs != null && node.errs.nonEmpty())
                     return getStartPos(node.errs.head);
             }

@@ -572,11 +576,11 @@
             case WILDCARD:
                 return getEndPos(((JCWildcard) tree).inner, endPosTable);
             case TYPECAST:
                 return getEndPos(((JCTypeCast) tree).expr, endPosTable);
             case TYPETEST:
-                return getEndPos(((JCInstanceOf) tree).clazz, endPosTable);
+                return getEndPos(((JCInstanceOf) tree).pattern, endPosTable);
             case WHILELOOP:
                 return getEndPos(((JCWhileLoop) tree).body, endPosTable);
             case ANNOTATED_TYPE:
                 return getEndPos(((JCAnnotatedType) tree).underlyingType, endPosTable);
             case ERRONEOUS: {

@@ -845,10 +849,12 @@
         case TYPE_ANNOTATION:
         case TYPEPARAMETER:
             if (node.type != null)
                 return node.type.tsym;
             return null;
+        case BINDINGPATTERN:
+            return ((JCBindingPattern) node).symbol;
         default:
             return null;
         }
     }
 

@@ -1223,6 +1229,7 @@
     }
 
     public static boolean isPackageInfo(JCCompilationUnit tree) {
         return tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE);
     }
+
 }
< prev index next >