Permalink
Browse files

JavacUtil #1052: Swallow completion failures of annotations because w…

…e catch them somewhere else
  • Loading branch information...
1 parent 8662770 commit c2ddeddd7df87a86d9da4babc8fa2e1ed5d52e41 @FroMage FroMage committed May 28, 2013
@@ -59,7 +59,7 @@
private List<FieldMirror> fields;
private LinkedList<ClassMirror> innerClasses;
-
+
public JavacClass(ClassSymbol classSymbol){
this.classSymbol = classSymbol;
}
@@ -28,15 +28,20 @@
import com.redhat.ceylon.compiler.loader.mirror.TypeParameterMirror;
import com.sun.tools.javac.code.Attribute.Compound;
import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symbol.CompletionFailure;
import com.sun.tools.javac.code.Symbol.TypeSymbol;
public class JavacUtil {
public static Map<String, AnnotationMirror> getAnnotations(Symbol symbol) {
HashMap<String, AnnotationMirror> result = new HashMap<String, AnnotationMirror>();
- com.sun.tools.javac.util.List<Compound> annotations = symbol.getAnnotationMirrors();
- for(Compound annotation : annotations){
- result.put(annotation.type.tsym.getQualifiedName().toString(), new JavacAnnotation(annotation));
+ try{
+ com.sun.tools.javac.util.List<Compound> annotations = symbol.getAnnotationMirrors();
+ for(Compound annotation : annotations){
+ result.put(annotation.type.tsym.getQualifiedName().toString(), new JavacAnnotation(annotation));
+ }
+ }catch(CompletionFailure x){
+ // ignore, it will be logged somewhere else
}
return result;
}

0 comments on commit c2ddedd

Please sign in to comment.