langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java
changeset 22163 3651128c74eb
parent 17278 a48ec76f26e9
child 23122 02c931d49ad2
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
   545         if (enterEnv == null)
   545         if (enterEnv == null)
   546             return null;
   546             return null;
   547         JCTree tree = TreeInfo.declarationFor(sym, enterEnv.tree);
   547         JCTree tree = TreeInfo.declarationFor(sym, enterEnv.tree);
   548         if (tree == null || enterEnv.toplevel == null)
   548         if (tree == null || enterEnv.toplevel == null)
   549             return null;
   549             return null;
   550         return new Pair<JCTree,JCCompilationUnit>(tree, enterEnv.toplevel);
   550         return new Pair<>(tree, enterEnv.toplevel);
   551     }
   551     }
   552 
   552 
   553     /**
   553     /**
   554      * Returns the best approximation for the tree node and compilation unit
   554      * Returns the best approximation for the tree node and compilation unit
   555      * corresponding to the given element, annotation and value.
   555      * corresponding to the given element, annotation and value.
   576             return elemTreeTop;
   576             return elemTreeTop;
   577 
   577 
   578         // 6388543: if v != null, we should search within annoTree to find
   578         // 6388543: if v != null, we should search within annoTree to find
   579         // the tree matching v. For now, we ignore v and return the tree of
   579         // the tree matching v. For now, we ignore v and return the tree of
   580         // the annotation.
   580         // the annotation.
   581         return new Pair<JCTree, JCCompilationUnit>(annoTree, elemTreeTop.snd);
   581         return new Pair<>(annoTree, elemTreeTop.snd);
   582     }
   582     }
   583 
   583 
   584     /**
   584     /**
   585      * Returns a symbol's enter environment, or null if it has none.
   585      * Returns a symbol's enter environment, or null if it has none.
   586      */
   586      */