errors) {
if (injection != null) {
for (InjectionPointInfo injectionPoint : injection.injectionPoints) {
diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionsEntryPoint.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionsEntryPoint.java
index cf490e5604ff8..b2ddd4f8829ec 100644
--- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionsEntryPoint.java
+++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/bcextensions/ExtensionsEntryPoint.java
@@ -12,6 +12,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import jakarta.enterprise.context.Dependent;
@@ -312,7 +313,7 @@ public void runSynthesis(org.jboss.jandex.IndexView beanArchiveIndex) {
*
* It is a no-op if no {@link BuildCompatibleExtension} was found.
*/
- public void registerSyntheticBeans(BeanRegistrar.RegistrationContext context) {
+ public void registerSyntheticBeans(BeanRegistrar.RegistrationContext context, Predicate isApplicationClass) {
if (invoker.isEmpty()) {
return;
}
@@ -424,6 +425,16 @@ public void registerSyntheticBeans(BeanRegistrar.RegistrationContext context) {
mc.returnValue(null);
});
}
+ // the generated classes need to see the `creatorClass` and the `disposerClass`,
+ // so if they are application classes, the generated classes are forced to also
+ // be application classes, even if the `implementationClass` possibly isn't
+ if (isApplicationClass.test(DotName.createSimple(syntheticBean.creatorClass))) {
+ bean.forceApplicationClass();
+ }
+ if (syntheticBean.disposerClass != null
+ && isApplicationClass.test(DotName.createSimple(syntheticBean.disposerClass))) {
+ bean.forceApplicationClass();
+ }
bean.done();
}
}
@@ -433,7 +444,8 @@ public void registerSyntheticBeans(BeanRegistrar.RegistrationContext context) {
*
* It is a no-op if no {@link BuildCompatibleExtension} was found.
*/
- public void registerSyntheticObservers(ObserverRegistrar.RegistrationContext context) {
+ public void registerSyntheticObservers(ObserverRegistrar.RegistrationContext context,
+ Predicate isApplicationClass) {
if (invoker.isEmpty()) {
return;
}
@@ -475,6 +487,12 @@ public void registerSyntheticObservers(ObserverRegistrar.RegistrationContext con
// return type is void
mc.returnValue(null);
});
+ // the generated classes need to see the `implementationClass`, so if it is
+ // an application class, the generated classes are forced to also be application
+ // classes, even if the `declaringClass` possibly isn't
+ if (isApplicationClass.test(DotName.createSimple(syntheticObserver.implementationClass))) {
+ observer.forceApplicationClass();
+ }
observer.done();
}
}