Skip to content

Commit

Permalink
Ensure @ApplicationScoped doesn't break default constructor generation
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Mar 4, 2024
1 parent 9a710df commit 5c2c46f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ List<AllowedJaxRsAnnotationPrefixBuildItem> registerCompatibleAnnotationPrefixes
prefixes.add(new AllowedJaxRsAnnotationPrefixBuildItem("jakarta.annotation.security"));
prefixes.add(new AllowedJaxRsAnnotationPrefixBuildItem("java.lang"));
prefixes.add(new AllowedJaxRsAnnotationPrefixBuildItem("jakarta.inject"));
prefixes.add(new AllowedJaxRsAnnotationPrefixBuildItem("jakarta.enterprise.context"));
return prefixes;
}

Expand Down Expand Up @@ -736,8 +737,11 @@ private static void generateDefaultConstructors(BuildProducer<BytecodeTransforme

boolean hasNonJaxRSAnnotations = false;
for (AnnotationInstance instance : classInfo.declaredAnnotations()) {
final String packageName = packageName(instance.name());
DotName name = instance.name();
final String packageName = packageName(name);
if (packageName == null || !isPackageAllowed(allowedAnnotationPrefixes, packageName)) {
log.warn("Annotation " + name + " results in Quarkus not being able to generate a default constructor for "
+ classInfo.name());
hasNonJaxRSAnnotations = true;
break;
}
Expand Down

0 comments on commit 5c2c46f

Please sign in to comment.