src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java
changeset 52777 7d3391e9df19
parent 52278 e11a53698d57
child 58713 ad69fd32778e
equal deleted inserted replaced
52776:c05ba185a1d3 52777:7d3391e9df19
   342                 c = tmp;
   342                 c = tmp;
   343             }
   343             }
   344 
   344 
   345             Assert.checkNonNull(c, "Failed to create annotation");
   345             Assert.checkNonNull(c, "Failed to create annotation");
   346 
   346 
   347             if (annotated.containsKey(a.type.tsym)) {
   347             if (a.type.tsym.isAnnotationType()) {
   348                 if (!allowRepeatedAnnos) {
   348                 if (annotated.containsKey(a.type.tsym)) {
   349                     log.error(DiagnosticFlag.SOURCE_LEVEL, a.pos(), Feature.REPEATED_ANNOTATIONS.error(sourceName));
   349                     if (!allowRepeatedAnnos) {
       
   350                         log.error(DiagnosticFlag.SOURCE_LEVEL, a.pos(), Feature.REPEATED_ANNOTATIONS.error(sourceName));
       
   351                     }
       
   352                     ListBuffer<T> l = annotated.get(a.type.tsym);
       
   353                     l = l.append(c);
       
   354                     annotated.put(a.type.tsym, l);
       
   355                     pos.put(c, a.pos());
       
   356                 } else {
       
   357                     annotated.put(a.type.tsym, ListBuffer.of(c));
       
   358                     pos.put(c, a.pos());
   350                 }
   359                 }
   351                 ListBuffer<T> l = annotated.get(a.type.tsym);
       
   352                 l = l.append(c);
       
   353                 annotated.put(a.type.tsym, l);
       
   354                 pos.put(c, a.pos());
       
   355             } else {
       
   356                 annotated.put(a.type.tsym, ListBuffer.of(c));
       
   357                 pos.put(c, a.pos());
       
   358             }
   360             }
   359 
   361 
   360             // Note: @Deprecated has no effect on local variables and parameters
   362             // Note: @Deprecated has no effect on local variables and parameters
   361             if (!c.type.isErroneous()
   363             if (!c.type.isErroneous()
   362                     && (toAnnotate.kind == MDL || toAnnotate.owner.kind != MTH)
   364                     && (toAnnotate.kind == MDL || toAnnotate.owner.kind != MTH)