--- old/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Tue Feb 24 17:49:21 2009 +++ new/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Tue Feb 24 17:49:21 2009 @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,6 +111,7 @@ */ public Set getElementsAnnotatedWith(TypeElement a) { Set result = Collections.emptySet(); + Types typeUtil = processingEnv.getTypeUtils(); if (a.getKind() != ElementKind.ANNOTATION_TYPE) throw new IllegalArgumentException(NOT_AN_ANNOTATION_TYPE + a); @@ -122,7 +123,7 @@ throw new AssertionError("Bad implementation type for " + tm); ElementScanner6, DeclaredType> scanner = - new AnnotationSetScanner(result); + new AnnotationSetScanner(result, typeUtil); for (Element element : rootElements) result = scanner.scan(element, annotationTypeElement); @@ -135,9 +136,11 @@ ElementScanner6, DeclaredType> { // Insertion-order preserving set Set annotatedElements = new LinkedHashSet(); + Types typeUtil; - AnnotationSetScanner(Set defaultSet) { + AnnotationSetScanner(Set defaultSet, Types typeUtil) { super(defaultSet); + this.typeUtil = typeUtil; } @Override @@ -145,7 +148,7 @@ java.util.List annotationMirrors = processingEnv.getElementUtils().getAllAnnotationMirrors(e); for (AnnotationMirror annotationMirror : annotationMirrors) { - if (annotationMirror.getAnnotationType().equals(p)) + if (typeUtil.isSameType(annotationMirror.getAnnotationType(), p)) annotatedElements.add(e); } e.accept(this, p);