25
25
import io .quarkus .deployment .builditem .FeatureBuildItem ;
26
26
import io .quarkus .deployment .builditem .IndexDependencyBuildItem ;
27
27
import io .quarkus .deployment .builditem .nativeimage .ReflectiveClassBuildItem ;
28
+ import io .quarkus .deployment .util .JandexUtil ;
28
29
import java .util .List ;
29
30
import java .util .Optional ;
30
31
import java .util .function .Function ;
36
37
import org .jboss .jandex .AnnotationValue ;
37
38
import org .jboss .jandex .ClassInfo ;
38
39
import org .jboss .jandex .DotName ;
39
- import org .jboss .jandex .Type ;
40
+ import org .jboss .jandex .IndexView ;
40
41
import org .jboss .logging .Logger ;
41
42
42
43
class QuarkusExtensionProcessor {
@@ -78,7 +79,7 @@ void createConfigurationServiceAndOperator(
78
79
79
80
final List <ControllerConfiguration > controllerConfigs =
80
81
resourceControllers .stream ()
81
- .map (ci -> createControllerConfiguration (ci , additionalBeans , reflectionClasses ))
82
+ .map (ci -> createControllerConfiguration (ci , additionalBeans , reflectionClasses , index ))
82
83
.collect (Collectors .toList ());
83
84
84
85
final var version = Utils .loadFromProperties ();
@@ -101,17 +102,14 @@ void createConfigurationServiceAndOperator(
101
102
private ControllerConfiguration createControllerConfiguration (
102
103
ClassInfo info ,
103
104
BuildProducer <AdditionalBeanBuildItem > additionalBeans ,
104
- BuildProducer <ReflectiveClassBuildItem > reflectionClasses ) {
105
+ BuildProducer <ReflectiveClassBuildItem > reflectionClasses ,
106
+ IndexView index ) {
105
107
// first retrieve the custom resource class
106
- final var rcInterface =
107
- info .interfaceTypes ().stream ()
108
- .filter (t -> t .name ().equals (RESOURCE_CONTROLLER ))
109
- .findFirst ()
110
- .map (Type ::asParameterizedType )
111
- // shouldn't happen since we're only dealing with ResourceController implementors
112
- // already
113
- .orElseThrow ();
114
- final var crType = rcInterface .arguments ().get (0 ).name ().toString ();
108
+ final var crType =
109
+ JandexUtil .resolveTypeParameters (info .name (), RESOURCE_CONTROLLER , index )
110
+ .get (0 )
111
+ .name ()
112
+ .toString ();
115
113
116
114
// create ResourceController bean
117
115
final var resourceControllerClassName = info .name ().toString ();
0 commit comments