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

changeset 1017
6762754eb7c0
parent 1015
6bb526ccf5ff
child 1085
ed338593b0b6
equal deleted inserted replaced
1016:6211df69f7e0 1017:6762754eb7c0
2238 */ 2238 */
2239 void validateAnnotationTree(JCTree tree) { 2239 void validateAnnotationTree(JCTree tree) {
2240 class AnnotationValidator extends TreeScanner { 2240 class AnnotationValidator extends TreeScanner {
2241 @Override 2241 @Override
2242 public void visitAnnotation(JCAnnotation tree) { 2242 public void visitAnnotation(JCAnnotation tree) {
2243 super.visitAnnotation(tree); 2243 if (!tree.type.isErroneous()) {
2244 validateAnnotation(tree); 2244 super.visitAnnotation(tree);
2245 validateAnnotation(tree);
2246 }
2245 } 2247 }
2246 } 2248 }
2247 tree.accept(new AnnotationValidator()); 2249 tree.accept(new AnnotationValidator());
2248 } 2250 }
2249 2251
2381 } 2383 }
2382 2384
2383 /** Check an annotation value. 2385 /** Check an annotation value.
2384 */ 2386 */
2385 public void validateAnnotation(JCAnnotation a) { 2387 public void validateAnnotation(JCAnnotation a) {
2386 if (a.type.isErroneous()) return;
2387
2388 // collect an inventory of the members (sorted alphabetically) 2388 // collect an inventory of the members (sorted alphabetically)
2389 Set<MethodSymbol> members = new TreeSet<MethodSymbol>(new Comparator<Symbol>() { 2389 Set<MethodSymbol> members = new TreeSet<MethodSymbol>(new Comparator<Symbol>() {
2390 public int compare(Symbol t, Symbol t1) { 2390 public int compare(Symbol t, Symbol t1) {
2391 return t.name.compareTo(t1.name); 2391 return t.name.compareTo(t1.name);
2392 } 2392 }

mercurial