@@ -1038,10 +1038,10 @@ private List<BeanInfo> findBeans(Collection<DotName> beanDefiningAnnotations, Li
1038
1038
if (annotationStore .hasAnnotation (method , DotNames .OBSERVES )) {
1039
1039
syncObserverMethods .computeIfAbsent (method , ignored -> new HashSet <>())
1040
1040
.add (beanClass );
1041
+ // add only concrete classes
1041
1042
if (!Modifier .isAbstract (beanClass .flags ())) {
1042
1043
// do not register classes with observers and no bean def. annotation as beans in strict mode
1043
1044
if (!strictCompatibility ) {
1044
- // add only concrete classes
1045
1045
beanClasses .add (beanClass );
1046
1046
if (!hasBeanDefiningAnnotation ) {
1047
1047
LOGGER .debugf (
@@ -1053,10 +1053,10 @@ private List<BeanInfo> findBeans(Collection<DotName> beanDefiningAnnotations, Li
1053
1053
} else if (annotationStore .hasAnnotation (method , DotNames .OBSERVES_ASYNC )) {
1054
1054
asyncObserverMethods .computeIfAbsent (method , ignored -> new HashSet <>())
1055
1055
.add (beanClass );
1056
+ // add only concrete classes
1056
1057
if (!Modifier .isAbstract (beanClass .flags ())) {
1057
1058
// do not register classes with observers and no bean def. annotation as beans in strict mode
1058
1059
if (!strictCompatibility ) {
1059
- // add only concrete classes
1060
1060
beanClasses .add (beanClass );
1061
1061
if (!hasBeanDefiningAnnotation ) {
1062
1062
LOGGER .debugf (
@@ -1080,12 +1080,19 @@ private List<BeanInfo> findBeans(Collection<DotName> beanDefiningAnnotations, Li
1080
1080
if (annotationStore .hasAnnotation (field , DotNames .INJECT )) {
1081
1081
throw new DefinitionException ("Injected field cannot be annotated with @Produces: " + field );
1082
1082
}
1083
+ // Do not register classes with producers and no bean def. annotation as beans in strict mode
1083
1084
// Producer fields are not inherited
1084
- producerFields .add (field );
1085
- if (!hasBeanDefiningAnnotation ) {
1086
- LOGGER .debugf ("Producer field found but %s has no bean defining annotation - using @Dependent" ,
1087
- beanClass );
1088
- beanClasses .add (beanClass );
1085
+ if (strictCompatibility ) {
1086
+ if (hasBeanDefiningAnnotation ) {
1087
+ producerFields .add (field );
1088
+ }
1089
+ } else {
1090
+ producerFields .add (field );
1091
+ if (!hasBeanDefiningAnnotation ) {
1092
+ LOGGER .debugf ("Producer field found but %s has no bean defining annotation - using @Dependent" ,
1093
+ beanClass );
1094
+ beanClasses .add (beanClass );
1095
+ }
1089
1096
}
1090
1097
} else {
1091
1098
// Verify that non-producer fields are not annotated with stereotypes
0 commit comments