src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 2814
380f6c17ea01
parent 2717
11743872bfc9
child 2893
ca5783d9a597
child 2904
14891e981af0
equal deleted inserted replaced
2813:d94fe2d29b1e 2814:380f6c17ea01
823 id.sym = env.info.scope.owner; 823 id.sym = env.info.scope.owner;
824 return id.type; 824 return id.type;
825 } 825 }
826 826
827 public void visitClassDef(JCClassDecl tree) { 827 public void visitClassDef(JCClassDecl tree) {
828 // Local classes have not been entered yet, so we need to do it now: 828 // Local and anonymous classes have not been entered yet, so we need to
829 if ((env.info.scope.owner.kind & (VAR | MTH)) != 0) 829 // do it now.
830 if ((env.info.scope.owner.kind & (VAR | MTH)) != 0) {
830 enter.classEnter(tree, env); 831 enter.classEnter(tree, env);
832 } else {
833 // If this class declaration is part of a class level annotation,
834 // as in @MyAnno(new Object() {}) class MyClass {}, enter it in
835 // order to simplify later steps and allow for sensible error
836 // messages.
837 if (env.tree.hasTag(NEWCLASS) && TreeInfo.isInAnnotation(env, tree))
838 enter.classEnter(tree, env);
839 }
831 840
832 ClassSymbol c = tree.sym; 841 ClassSymbol c = tree.sym;
833 if (c == null) { 842 if (c == null) {
834 // exit in case something drastic went wrong during enter. 843 // exit in case something drastic went wrong during enter.
835 result = null; 844 result = null;

mercurial