File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
engine/src/main/java/org/hibernate/validator/internal/xml/config Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 16
16
import javax .validation .BootstrapConfiguration ;
17
17
import javax .validation .executable .ExecutableType ;
18
18
19
+ import org .hibernate .validator .internal .util .CollectionHelper ;
19
20
import org .hibernate .validator .internal .util .stereotypes .Immutable ;
20
21
21
22
/**
@@ -109,15 +110,23 @@ private Set<ExecutableType> prepareValidatedExecutableTypes(EnumSet<ExecutableTy
109
110
if ( validatedExecutableTypes == null ) {
110
111
return DEFAULT_VALIDATED_EXECUTABLE_TYPES ;
111
112
}
113
+
112
114
if ( validatedExecutableTypes .contains ( ExecutableType .ALL ) ) {
113
115
return ALL_VALIDATED_EXECUTABLE_TYPES ;
114
116
}
115
- else if ( validatedExecutableTypes .contains ( ExecutableType .NONE ) ) {
116
- return EnumSet .noneOf ( ExecutableType .class );
117
- }
118
- else {
119
- return validatedExecutableTypes ;
117
+
118
+ if ( validatedExecutableTypes .contains ( ExecutableType .NONE ) ) {
119
+ if ( validatedExecutableTypes .size () == 1 ) {
120
+ return Collections .emptySet ();
121
+ }
122
+ else {
123
+ EnumSet <ExecutableType > preparedValidatedExecutableTypes = EnumSet .copyOf ( validatedExecutableTypes );
124
+ preparedValidatedExecutableTypes .remove ( ExecutableType .NONE );
125
+ return CollectionHelper .toImmutableSet ( preparedValidatedExecutableTypes );
126
+ }
120
127
}
128
+
129
+ return CollectionHelper .toImmutableSet ( validatedExecutableTypes );
121
130
}
122
131
123
132
@ Override
You can’t perform that action at this time.
0 commit comments