From 5df5b55592131447df68fe6c236fd7b5e95bd3ed Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Fri, 2 Aug 2024 11:07:03 +0300 Subject: [PATCH] Register superinterfaces of SmallRye FT annotated beans --- .../deployment/SmallRyeFaultToleranceProcessor.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java b/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java index d3fe8484a5f9db..003aff3a267c2d 100644 --- a/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java +++ b/extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java @@ -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 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> entry : classesToScan.entrySet()) { @@ -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());