@@ -395,14 +395,10 @@ Set<AnnotationInstance> getAnnotationsToAdd(
395395 Collections .singletonList ((AnnotationValue .createStringValue ("value" , value )))));
396396 }
397397 }
398-
399- // in Spring List<SomeBean> means that all instances of SomeBean should be injected
400- if (fieldInfo .type ().name ().equals (DotNames .LIST )) {
401- annotationsToAdd .add (create (
402- QUARKUS_ALL_ANNOTATION ,
403- target ,
404- Collections .emptyList ()));
405- }
398+ addAllAnnotationOnListField (target , annotationsToAdd , fieldInfo );
399+ } else if (fieldInfo .hasAnnotation (CDI_INJECT_ANNOTATION )) {
400+ // Mix case of JSR-303 support in Spring
401+ addAllAnnotationOnListField (target , annotationsToAdd , fieldInfo );
406402 } else if (fieldInfo .hasAnnotation (SPRING_VALUE_ANNOTATION )) {
407403 final AnnotationInstance annotation = fieldInfo .annotation (SPRING_VALUE_ANNOTATION );
408404 addSpringValueAnnotations (target , annotation , true , annotationsToAdd );
@@ -437,18 +433,11 @@ Set<AnnotationInstance> getAnnotationsToAdd(
437433 CDI_INJECT_ANNOTATION ,
438434 target ,
439435 Collections .emptyList ()));
440- // in Spring List<SomeBean> means that all instances of SomeBean should be injected
441- List <Type > parameters = methodInfo .parameterTypes ();
442- for (int i = 0 ; i < parameters .size (); i ++) {
443- Type parameter = parameters .get (i );
444- if (parameter .name ().equals (DotNames .LIST )) {
445- annotationsToAdd .add (create (
446- QUARKUS_ALL_ANNOTATION ,
447- MethodParameterInfo .create (methodInfo , (short ) i ),
448- Collections .emptyList ()));
449- }
450- }
436+ addAllAnnotationOnMethodListParameters (annotationsToAdd , methodInfo );
451437
438+ } else if (methodInfo .hasAnnotation (CDI_INJECT_ANNOTATION )) {
439+ // Mix case of JSR-303 support in Spring
440+ addAllAnnotationOnMethodListParameters (annotationsToAdd , methodInfo );
452441 }
453442
454443 // add method parameter conversion annotations
@@ -473,6 +462,31 @@ Set<AnnotationInstance> getAnnotationsToAdd(
473462 return annotationsToAdd ;
474463 }
475464
465+ private void addAllAnnotationOnListField (AnnotationTarget target , Set <AnnotationInstance > annotationsToAdd ,
466+ FieldInfo fieldInfo ) {
467+ // in Spring List<SomeBean> means that all instances of SomeBean should be injected
468+ if (fieldInfo .type ().name ().equals (DotNames .LIST )) {
469+ annotationsToAdd .add (create (
470+ QUARKUS_ALL_ANNOTATION ,
471+ target ,
472+ Collections .emptyList ()));
473+ }
474+ }
475+
476+ private void addAllAnnotationOnMethodListParameters (Set <AnnotationInstance > annotationsToAdd , MethodInfo methodInfo ) {
477+ // in Spring List<SomeBean> means that all instances of SomeBean should be injected
478+ List <Type > parameters = methodInfo .parameterTypes ();
479+ for (int i = 0 ; i < parameters .size (); i ++) {
480+ Type parameter = parameters .get (i );
481+ if (parameter .name ().equals (DotNames .LIST )) {
482+ annotationsToAdd .add (create (
483+ QUARKUS_ALL_ANNOTATION ,
484+ MethodParameterInfo .create (methodInfo , (short ) i ),
485+ Collections .emptyList ()));
486+ }
487+ }
488+ }
489+
476490 /**
477491 * Meant to be called with instances of @Component, @Service, @Repository
478492 */
0 commit comments