Skip to content

Commit

Permalink
Avoid calling getPackage() on an annotation type due to an issue with…
Browse files Browse the repository at this point in the history
… GraalVM 21.3.X. Sometimes it returns the correct package, sometimes it does not (returning the annotation's proxy class package instead). Also fixed package name in filtering optimization. See issue 4296. (#4350)

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas authored Jun 8, 2022
1 parent 960c3bb commit 6917a24
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class AnnotationFinder {
"java.",
"javax.",
"jakarta.",
"org.microprofile."
"org.eclipse.microprofile."
};

private final Package pkg;
Expand Down Expand Up @@ -84,7 +84,7 @@ private Set<Annotation> findAnnotations(Set<Annotation> set, Set<Annotation> res
Set<Annotation> seen, Package pkg, BeanManager bm) {
for (Annotation a1 : set) {
Class<? extends Annotation> a1Type = a1.annotationType();
if (a1Type.getPackage().equals(pkg)) {
if (a1Type.getName().startsWith(pkg.getName())) { // Avoid getPackage() - Issue #4296
result.add(a1);
} else if (!seen.contains(a1) && isOfInterest(a1, bm)) {
seen.add(a1);
Expand Down

0 comments on commit 6917a24

Please sign in to comment.