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

changeset 1802
8fb68f73d4b1
parent 1791
e9855150c5b0
child 1820
6b48ebae2569
equal deleted inserted replaced
1801:775a51e3276f 1802:8fb68f73d4b1
710 memberEnter(tree.errs, env); 710 memberEnter(tree.errs, env);
711 } 711 }
712 712
713 public Env<AttrContext> getMethodEnv(JCMethodDecl tree, Env<AttrContext> env) { 713 public Env<AttrContext> getMethodEnv(JCMethodDecl tree, Env<AttrContext> env) {
714 Env<AttrContext> mEnv = methodEnv(tree, env); 714 Env<AttrContext> mEnv = methodEnv(tree, env);
715 mEnv.info.lint = mEnv.info.lint.augment(tree.sym.annotations, tree.sym.flags()); 715 mEnv.info.lint = mEnv.info.lint.augment(tree.sym);
716 for (List<JCTypeParameter> l = tree.typarams; l.nonEmpty(); l = l.tail) 716 for (List<JCTypeParameter> l = tree.typarams; l.nonEmpty(); l = l.tail)
717 mEnv.info.scope.enterIfAbsent(l.head.type.tsym); 717 mEnv.info.scope.enterIfAbsent(l.head.type.tsym);
718 for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) 718 for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail)
719 mEnv.info.scope.enterIfAbsent(l.head.sym); 719 mEnv.info.scope.enterIfAbsent(l.head.sym);
720 return mEnv; 720 return mEnv;
751 final Symbol s) { 751 final Symbol s) {
752 if (annotations.isEmpty()) { 752 if (annotations.isEmpty()) {
753 return; 753 return;
754 } 754 }
755 if (s.kind != PCK) { 755 if (s.kind != PCK) {
756 s.annotations.reset(); // mark Annotations as incomplete for now 756 s.resetAnnotations(); // mark Annotations as incomplete for now
757 } 757 }
758 annotate.normal(new Annotate.Annotator() { 758 annotate.normal(new Annotate.Annotator() {
759 @Override 759 @Override
760 public String toString() { 760 public String toString() {
761 return "annotate " + annotations + " onto " + s + " in " + s.owner; 761 return "annotate " + annotations + " onto " + s + " in " + s.owner;
762 } 762 }
763 763
764 @Override 764 @Override
765 public void enterAnnotation() { 765 public void enterAnnotation() {
766 Assert.check(s.kind == PCK || s.annotations.pendingCompletion()); 766 Assert.check(s.kind == PCK || s.annotationsPendingCompletion());
767 JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile); 767 JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
768 try { 768 try {
769 if (!s.annotations.isEmpty() && 769 if (s.hasAnnotations() &&
770 annotations.nonEmpty()) 770 annotations.nonEmpty())
771 log.error(annotations.head.pos, 771 log.error(annotations.head.pos,
772 "already.annotated", 772 "already.annotated",
773 kindName(s), s); 773 kindName(s), s);
774 actualEnterAnnotations(annotations, localEnv, s); 774 actualEnterAnnotations(annotations, localEnv, s);
830 && types.isSameType(c.type, syms.deprecatedType)) { 830 && types.isSameType(c.type, syms.deprecatedType)) {
831 s.flags_field |= Flags.DEPRECATED; 831 s.flags_field |= Flags.DEPRECATED;
832 } 832 }
833 } 833 }
834 834
835 s.annotations.setDeclarationAttributesWithCompletion( 835 s.setDeclarationAttributesWithCompletion(
836 annotate.new AnnotateRepeatedContext<Attribute.Compound>(env, annotated, pos, log, false)); 836 annotate.new AnnotateRepeatedContext<Attribute.Compound>(env, annotated, pos, log, false));
837 } 837 }
838 838
839 /** Queue processing of an attribute default value. */ 839 /** Queue processing of an attribute default value. */
840 void annotateDefaultValueLater(final JCExpression defaultValue, 840 void annotateDefaultValueLater(final JCExpression defaultValue,
1105 pos.put(tc, a.pos()); 1105 pos.put(tc, a.pos());
1106 } 1106 }
1107 } 1107 }
1108 1108
1109 if (s != null) { 1109 if (s != null) {
1110 s.annotations.appendTypeAttributesWithCompletion( 1110 s.appendTypeAttributesWithCompletion(
1111 annotate.new AnnotateRepeatedContext<Attribute.TypeCompound>(env, annotated, pos, log, true)); 1111 annotate.new AnnotateRepeatedContext<Attribute.TypeCompound>(env, annotated, pos, log, true));
1112 } 1112 }
1113 } 1113 }
1114 1114
1115 public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym) { 1115 public void typeAnnotate(final JCTree tree, final Env<AttrContext> env, final Symbol sym) {

mercurial