Skip to content

Commit

Permalink
Arc - Add null check when trying to load qualifier class
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn authored and holly-cummins committed Jul 31, 2024
1 parent 1ae8c74 commit 7427a08
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,12 @@ static boolean hasQualifier(BeanDeployment beanDeployment, AnnotationInstance re
//as this is called in a tight loop we only do it if necessary
values = new ArrayList<>();
Set<String> nonBindingFields = beanDeployment.getQualifierNonbindingMembers(requiredQualifier.name());
if (requiredClazz == null) {
throw new IllegalStateException("Failed to find bean qualifier class with name "
+ requiredQualifier.name() + " in application index. Make sure the class is part of "
+ "the Jandex index. Classes that are not subject to discovery can be registered via "
+ "AdditionalBeanBuildItem and non-qualifier annotations can use QualifierRegistrarBuildItem");
}
for (AnnotationValue val : requiredQualifier.valuesWithDefaults(beanDeployment.getBeanArchiveIndex())) {
if (!requiredClazz.method(val.name()).hasAnnotation(DotNames.NONBINDING)
&& !nonBindingFields.contains(val.name())) {
Expand Down

0 comments on commit 7427a08

Please sign in to comment.