Attribute.TypeCompound enterTypeAnnotation(JCAnnotation a, Type expected, Env<AttrContext> env) { return (Attribute.TypeCompound) enterAnnotation(a, expected, env, true); }
/** Process a single compound annotation, returning its * Attribute. Used from MemberEnter for attaching the attributes * to the annotated symbol. */ Attribute.Compound enterAnnotation(JCAnnotation a, Type expected, Env<AttrContext> env) { return enterAnnotation(a, expected, env, false); }
/** Process a single compound annotation, returning its * Attribute. Used from MemberEnter for attaching the attributes * to the annotated symbol. */ Attribute.Compound enterAnnotation(JCAnnotation a, Type expected, Env<AttrContext> env) { return enterAnnotation(a, expected, env, false); }
Attribute.TypeCompound enterTypeAnnotation(JCAnnotation a, Type expected, Env<AttrContext> env) { return (Attribute.TypeCompound) enterAnnotation(a, expected, env, true); }
Attribute.Compound c = annotate.enterAnnotation(a, syms.annotationType, env);
Attribute.Compound c = annotate.enterAnnotation(a, syms.annotationType, env);
/** Enter a set of annotations. */ private void enterAnnotations(List<JCAnnotation> annotations, Env<AttrContext> env, Symbol s) { ListBuffer<Attribute.Compound> buf = new ListBuffer<Attribute.Compound>(); Set<TypeSymbol> annotated = new HashSet<TypeSymbol>(); if (!skipAnnotations) for (List<JCAnnotation> al = annotations; al.nonEmpty(); al = al.tail) { JCAnnotation a = al.head; Attribute.Compound c = annotate.enterAnnotation(a, syms.annotationType, env); if (c == null) continue; buf.append(c); // Note: @Deprecated has no effect on local variables and parameters if (!c.type.isErroneous() && s.owner.kind != MTH && types.isSameType(c.type, syms.deprecatedType)) s.flags_field |= Flags.DEPRECATED; if (!annotated.add(a.type.tsym)) log.error(a.pos, "duplicate.annotation"); } s.attributes_field = buf.toList(); }
/** Enter a set of annotations. */ private void enterAnnotations(List<JCAnnotation> annotations, Env<AttrContext> env, Symbol s) { ListBuffer<Attribute.Compound> buf = new ListBuffer<Attribute.Compound>(); Set<TypeSymbol> annotated = new HashSet<TypeSymbol>(); if (!skipAnnotations) for (List<JCAnnotation> al = annotations; al.nonEmpty(); al = al.tail) { JCAnnotation a = al.head; Attribute.Compound c = annotate.enterAnnotation(a, syms.annotationType, env); if (c == null) continue; buf.append(c); // Note: @Deprecated has no effect on local variables and parameters if (!c.type.isErroneous() && s.owner.kind != MTH && types.isSameType(c.type, syms.deprecatedType)) s.flags_field |= Flags.DEPRECATED; if (!annotated.add(a.type.tsym)) log.error(a.pos, "duplicate.annotation"); } s.attributes_field = buf.toList(); }
log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType); c = enterAnnotation(annoTree, targetContainerType, ctx.env); c.setSynthesized(true);
log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType); c = enterAnnotation(annoTree, targetContainerType, ctx.env); c.setSynthesized(true);
return enterAnnotation((JCAnnotation)tree, expected, env); } else { log.error(tree.pos(), "annotation.value.must.be.annotation"); if (!expected.isErroneous()) log.error(tree.pos(), "annotation.not.valid.for.type", expected); enterAnnotation((JCAnnotation)tree, syms.errType, env); return new Attribute.Error(((JCAnnotation)tree).annotationType.type);
return enterAnnotation((JCAnnotation)tree, expected, env); } else { log.error(tree.pos(), "annotation.value.must.be.annotation"); if (!expected.isErroneous()) log.error(tree.pos(), "annotation.not.valid.for.type", expected); enterAnnotation((JCAnnotation)tree, syms.errType, env); return new Attribute.Error(((JCAnnotation)tree).annotationType.type);
expected = syms.errorType; return enterAnnotation((JCAnnotation)tree, expected, env);
expected = syms.errorType; return enterAnnotation((JCAnnotation)tree, expected, env);