src/share/classes/com/sun/tools/javac/model/JavacElements.java

Print this page

        

*** 47,56 **** --- 47,57 ---- import com.sun.tools.javac.tree.TreeScanner; import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.Name; import static javax.lang.model.util.ElementFilter.methodsIn; + import static com.sun.tools.javac.tree.JCTree.Tag.*; /** * Utility methods for operating on program elements. * * <p><b>This is NOT part of any supported API.
*** 286,296 **** } } } } public void visitArray(Attribute.Array array) { ! if (tree.getTag() == JCTree.NEWARRAY && types.elemtype(array.type).tsym == findme.type.tsym) { List<JCExpression> elems = ((JCNewArray) tree).elems; for (Attribute value : array.values) { if (value == findme) { result = elems.head; --- 287,297 ---- } } } } public void visitArray(Attribute.Array array) { ! if (tree.hasTag(NEWARRAY) && types.elemtype(array.type).tsym == findme.type.tsym) { List<JCExpression> elems = ((JCNewArray) tree).elems; for (Attribute value : array.values) { if (value == findme) { result = elems.head;
*** 325,335 **** public void visitAnnotation(JCAnnotation t) { if (t == tree) scan(t.args); } public void visitAssign(JCAssign t) { ! if (t.lhs.getTag() == JCTree.IDENT) { JCIdent ident = (JCIdent) t.lhs; if (ident.sym == sym) result = t.rhs; } } --- 326,336 ---- public void visitAnnotation(JCAnnotation t) { if (t == tree) scan(t.args); } public void visitAssign(JCAssign t) { ! if (t.lhs.hasTag(IDENT)) { JCIdent ident = (JCIdent) t.lhs; if (ident.sym == sym) result = t.rhs; } }