28 import com.sun.tools.javac.code.*; |
28 import com.sun.tools.javac.code.*; |
29 import com.sun.tools.javac.code.Attribute.Compound; |
29 import com.sun.tools.javac.code.Attribute.Compound; |
30 import com.sun.tools.javac.code.Attribute.TypeCompound; |
30 import com.sun.tools.javac.code.Attribute.TypeCompound; |
31 import com.sun.tools.javac.code.Kinds.KindSelector; |
31 import com.sun.tools.javac.code.Kinds.KindSelector; |
32 import com.sun.tools.javac.code.Scope.WriteableScope; |
32 import com.sun.tools.javac.code.Scope.WriteableScope; |
|
33 import com.sun.tools.javac.code.Source.Feature; |
33 import com.sun.tools.javac.code.Symbol.*; |
34 import com.sun.tools.javac.code.Symbol.*; |
34 import com.sun.tools.javac.code.TypeMetadata.Entry.Kind; |
35 import com.sun.tools.javac.code.TypeMetadata.Entry.Kind; |
35 import com.sun.tools.javac.comp.Check.CheckContext; |
36 import com.sun.tools.javac.comp.Check.CheckContext; |
36 import com.sun.tools.javac.resources.CompilerProperties.Errors; |
37 import com.sun.tools.javac.resources.CompilerProperties.Errors; |
|
38 import com.sun.tools.javac.resources.CompilerProperties.Fragments; |
37 import com.sun.tools.javac.tree.JCTree; |
39 import com.sun.tools.javac.tree.JCTree; |
38 import com.sun.tools.javac.tree.JCTree.*; |
40 import com.sun.tools.javac.tree.JCTree.*; |
39 import com.sun.tools.javac.tree.TreeInfo; |
41 import com.sun.tools.javac.tree.TreeInfo; |
40 import com.sun.tools.javac.tree.TreeMaker; |
42 import com.sun.tools.javac.tree.TreeMaker; |
41 import com.sun.tools.javac.tree.TreeScanner; |
43 import com.sun.tools.javac.tree.TreeScanner; |
119 types = Types.instance(context); |
121 types = Types.instance(context); |
120 |
122 |
121 theUnfinishedDefaultValue = new Attribute.Error(syms.errType); |
123 theUnfinishedDefaultValue = new Attribute.Error(syms.errType); |
122 |
124 |
123 Source source = Source.instance(context); |
125 Source source = Source.instance(context); |
124 allowRepeatedAnnos = source.allowRepeatedAnnotations(); |
126 allowRepeatedAnnos = Feature.REPEATED_ANNOTATIONS.allowedInSource(source); |
125 sourceName = source.name; |
127 sourceName = source.name; |
126 |
128 |
127 blockCount = 1; |
129 blockCount = 1; |
128 } |
130 } |
129 |
131 |
342 |
344 |
343 Assert.checkNonNull(c, "Failed to create annotation"); |
345 Assert.checkNonNull(c, "Failed to create annotation"); |
344 |
346 |
345 if (annotated.containsKey(a.type.tsym)) { |
347 if (annotated.containsKey(a.type.tsym)) { |
346 if (!allowRepeatedAnnos) { |
348 if (!allowRepeatedAnnos) { |
347 log.error(DiagnosticFlag.SOURCE_LEVEL, a.pos(), Errors.RepeatableAnnotationsNotSupportedInSource(sourceName)); |
349 log.error(DiagnosticFlag.SOURCE_LEVEL, a.pos(), Feature.REPEATED_ANNOTATIONS.error(sourceName)); |
348 } |
350 } |
349 ListBuffer<T> l = annotated.get(a.type.tsym); |
351 ListBuffer<T> l = annotated.get(a.type.tsym); |
350 l = l.append(c); |
352 l = l.append(c); |
351 annotated.put(a.type.tsym, l); |
353 annotated.put(a.type.tsym, l); |
352 pos.put(c, a.pos()); |
354 pos.put(c, a.pos()); |