diff --git a/runtime/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF b/runtime/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF index a084435dfde..d078fb13381 100644 --- a/runtime/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF +++ b/runtime/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF @@ -15,7 +15,7 @@ Export-Package: org.eclipse.e4.core.di;version="1.7.0", org.eclipse.e4.core.internal.di.osgi;x-internal:=true, org.eclipse.e4.core.internal.di.shared;x-friends:="org.eclipse.e4.core.contexts,org.eclipse.e4.core.di.extensions.supplier" Require-Bundle: org.eclipse.e4.core.di.annotations;bundle-version="[1.4.0,2.0.0)";visibility:=reexport -Import-Package: jakarta.annotation;version="[2,3)", +Import-Package: jakarta.annotation;version="[2,4)", jakarta.inject;version="[2,3)", javax.annotation;version="[1.3.0,2.0.0)";resolution:=optional, javax.inject;version="[1.0.0,2.0.0)";resolution:=optional, diff --git a/runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/AnnotationLookup.java b/runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/AnnotationLookup.java index d6793c24280..568257b3a9b 100644 --- a/runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/AnnotationLookup.java +++ b/runtime/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/AnnotationLookup.java @@ -42,14 +42,15 @@ public class AnnotationLookup { private AnnotationLookup() { } - public static record AnnotationProxy(List> classes) { - public AnnotationProxy { - classes = List.copyOf(classes); + static record AnnotationProxy(List> classes, List classNames) { + + public AnnotationProxy(List> classes) { + this(List.copyOf(classes), classes.stream().map(Class::getCanonicalName).toList()); } public boolean isPresent(AnnotatedElement element) { - for (Class annotationClass : classes) { - if (element.isAnnotationPresent(annotationClass)) { + for (Annotation annotation : element.getAnnotations()) { + if (classNames.contains(annotation.annotationType().getCanonicalName())) { return true; } }