7070import io .quarkus .deployment .builditem .nativeimage .NativeImageResourceBundleBuildItem ;
7171import io .quarkus .deployment .builditem .nativeimage .NativeImageSystemPropertyBuildItem ;
7272import io .quarkus .deployment .builditem .nativeimage .ReflectiveClassBuildItem ;
73- import io .quarkus .deployment .builditem .nativeimage .ReflectiveHierarchyBuildItem ;
7473import io .quarkus .deployment .builditem .nativeimage .ReflectiveHierarchyIgnoreWarningBuildItem ;
7574import io .quarkus .deployment .builditem .nativeimage .RuntimeInitializedClassBuildItem ;
7675import io .quarkus .deployment .builditem .nativeimage .ServiceProviderBuildItem ;
@@ -187,7 +186,6 @@ void processAnnotationsAndIndexFiles(
187186 BuildProducer <NativeImageProxyDefinitionBuildItem > proxyDefinitions ,
188187 CombinedIndexBuildItem combinedIndexBuildItem ,
189188 List <JaxbFileRootBuildItem > fileRoots ,
190- BuildProducer <ReflectiveHierarchyBuildItem > reflectiveHierarchies ,
191189 BuildProducer <ReflectiveClassBuildItem > reflectiveClass ,
192190 BuildProducer <NativeImageResourceBuildItem > resource ,
193191 BuildProducer <NativeImageResourceBundleBuildItem > resourceBundle ,
@@ -204,11 +202,10 @@ void processAnnotationsAndIndexFiles(
204202 for (DotName jaxbRootAnnotation : JAXB_ROOT_ANNOTATIONS ) {
205203 for (AnnotationInstance jaxbRootAnnotationInstance : index
206204 .getAnnotations (jaxbRootAnnotation )) {
207- if (jaxbRootAnnotationInstance .target ().kind () == Kind .CLASS
208- && !JAXB_ANNOTATIONS .contains (jaxbRootAnnotationInstance .target ().asClass ().getClass ())) {
209- DotName targetClass = jaxbRootAnnotationInstance .target ().asClass ().name ();
210- addReflectiveHierarchyClass (targetClass , reflectiveHierarchies , index );
211- classesToBeBound .add (targetClass .toString ());
205+ if (jaxbRootAnnotationInstance .target ().kind () == Kind .CLASS ) {
206+ String className = jaxbRootAnnotationInstance .target ().asClass ().name ().toString ();
207+ reflectiveClass .produce (ReflectiveClassBuildItem .builder (className ).methods ().fields ().build ());
208+ classesToBeBound .add (className );
212209 jaxbRootAnnotationsDetected = true ;
213210 }
214211 }
@@ -415,17 +412,6 @@ public static Stream<Path> safeWalk(Path p) {
415412 }
416413 }
417414
418- private void addReflectiveHierarchyClass (DotName className ,
419- BuildProducer <ReflectiveHierarchyBuildItem > reflectiveHierarchy ,
420- IndexView index ) {
421- Type jandexType = Type .create (className , Type .Kind .CLASS );
422- reflectiveHierarchy .produce (new ReflectiveHierarchyBuildItem .Builder ()
423- .type (jandexType )
424- .index (index )
425- .source (getClass ().getSimpleName () + " > " + jandexType .name ().toString ())
426- .build ());
427- }
428-
429415 private void addReflectiveClass (BuildProducer <ReflectiveClassBuildItem > reflectiveClass , boolean methods , boolean fields ,
430416 String ... className ) {
431417 reflectiveClass .produce (new ReflectiveClassBuildItem (methods , fields , className ));
0 commit comments