diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java index cbb3f8f91dbad8..7de89735072ba3 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java @@ -262,6 +262,21 @@ public static ResourceScanningResult scanResources( } } + // handle abstract classes + scannedResources.values().stream().filter(ClassInfo::isAbstract).forEach(abstractScannedResource -> { + Collection allSubclasses = index.getAllKnownSubclasses(abstractScannedResource.name()); + if (allSubclasses.size() != 1) { + return; // don't do anything with this case as it's not evident how it's supposed to be handled + } + ClassInfo subclass = allSubclasses.iterator().next(); + if (!scannedResources.containsKey(subclass.name())) { + scannedResources.put(subclass.name(), subclass); + scannedResources.remove(abstractScannedResource.name()); + scannedResourcePaths.put(subclass.name(), scannedResourcePaths.get(abstractScannedResource.name())); + scannedResourcePaths.remove(abstractScannedResource.name()); + } + }); + Map clientInterfaces = new HashMap<>(pathInterfaces); // for clients it is enough to have @PATH annotations on methods only for (DotName interfaceName : interfacesWithPathOnMethods) {