Skip to content

Commit

Permalink
Register superinterfaces of SmallRye FT annotated beans
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Aug 2, 2024
1 parent 3182f74 commit 5df5b55
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,18 @@ void processFallbackMethodsAndClases(BeanArchiveIndexBuildItem beanArchiveIndexB
continue;
}

// Scan both the hierarchy of the declaring class and its interfaces like in
// Scan both the hierarchy of the declaring class and its (super)interfaces like in
// io.smallrye.faulttolerance.internal.SecurityActions.findDeclaredMethodNames
DotName name = clazz.name();
while (name != null && !DotNames.OBJECT.equals(name)) {
Set<String> methods = classesToScan.computeIfAbsent(name, k -> new HashSet<>());
methods.add(fallbackMethod);
classesToScan.computeIfAbsent(name, k1 -> new HashSet<>()).add(fallbackMethod);
clazz.interfaceNames().forEach(it -> classesToScan.computeIfAbsent(it, k -> new HashSet<>()).add(fallbackMethod));
ClassInfo classInfo = index.getClassByName(name);
if (classInfo == null) {
break;
}
name = classInfo.superName();
}
clazz.interfaceNames().forEach(it -> classesToScan.computeIfAbsent(it, k -> new HashSet<>()).add(fallbackMethod));
}

for (Map.Entry<DotName, Set<String>> entry : classesToScan.entrySet()) {
Expand All @@ -266,7 +265,7 @@ void processFallbackMethodsAndClases(BeanArchiveIndexBuildItem beanArchiveIndexB
// interfaces of the bean class and its superclasses through
// io.smallrye.faulttolerance.internal.SecurityActions.findDeclaredMethodNames
if (classInfo.isInterface()) {
// fot interfaces getMethods() is invoked in addition to getDeclaredMethods()
// for interfaces getMethods() is invoked in addition to getDeclaredMethods()
reflectiveClass.produce(ReflectiveClassBuildItem.builder(name.toString()).queryPublicMethods().build());
}
reflectiveClass.produce(ReflectiveClassBuildItem.builder(name.toString()).queryMethods().build());
Expand Down

0 comments on commit 5df5b55

Please sign in to comment.