--- old/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java 2012-03-04 21:21:41.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java 2012-03-04 21:21:41.000000000 -0800 @@ -66,6 +66,7 @@ private final Names names; private final Enter enter; + private final Source source; private final Log log; private final Check chk; private final Attr attr; @@ -92,6 +93,7 @@ context.put(memberEnterKey, this); names = Names.instance(context); enter = Enter.instance(context); + source = Source.instance(context); log = Log.instance(context); chk = Check.instance(context); attr = Attr.instance(context); @@ -802,8 +804,13 @@ // Pull the flag through for better diagnostics, even on a bad target. s.flags_field |= Flags.POLYMORPHIC_SIGNATURE; } - if (!annotated.add(a.type.tsym)) - log.error(a.pos, "duplicate.annotation"); + if (!annotated.add(a.type.tsym)) { + if (source.allowRepeatedAnnotations()) { + // Does the annotation being added have a valid container? + ; + } else + log.error(a.pos, "duplicate.annotation"); + } } s.attributes_field = buf.toList(); }