private EnumSet<ExecutableType> commonExecutableTypeChecks(ValidateOnExecution validateOnExecutionAnnotation) { if ( validateOnExecutionAnnotation == null ) { return EnumSet.noneOf( ExecutableType.class ); } EnumSet<ExecutableType> executableTypes = EnumSet.noneOf( ExecutableType.class ); if ( validateOnExecutionAnnotation.type().length == 0 ) { // HV-757 executableTypes.add( ExecutableType.NONE ); } else { Collections.addAll( executableTypes, validateOnExecutionAnnotation.type() ); } // IMPLICIT cannot be mixed 10.1.2 of spec - Mixing IMPLICIT and other executable types is illegal if ( executableTypes.contains( ExecutableType.IMPLICIT ) && executableTypes.size() > 1 ) { throw log.getMixingImplicitWithOtherExecutableTypesException(); } // NONE can be removed 10.1.2 of spec - A list containing NONE and other types of executables is equivalent to a // list containing the types of executables without NONE. if ( executableTypes.contains( ExecutableType.NONE ) && executableTypes.size() > 1 ) { executableTypes.remove( ExecutableType.NONE ); } // 10.1.2 of spec - A list containing ALL and other types of executables is equivalent to a list containing only ALL if ( executableTypes.contains( ExecutableType.ALL ) ) { executableTypes = ALL_EXECUTABLE_TYPES; } return executableTypes; }
private EnumSet<ExecutableType> commonExecutableTypeChecks(ValidateOnExecution validateOnExecutionAnnotation) { if ( validateOnExecutionAnnotation == null ) { return EnumSet.noneOf( ExecutableType.class ); } EnumSet<ExecutableType> executableTypes = EnumSet.noneOf( ExecutableType.class ); if ( validateOnExecutionAnnotation.type().length == 0 ) { // HV-757 executableTypes.add( ExecutableType.NONE ); } else { Collections.addAll( executableTypes, validateOnExecutionAnnotation.type() ); } // IMPLICIT cannot be mixed 10.1.2 of spec - Mixing IMPLICIT and other executable types is illegal if ( executableTypes.contains( ExecutableType.IMPLICIT ) && executableTypes.size() > 1 ) { throw log.getMixingImplicitWithOtherExecutableTypesException(); } // NONE can be removed 10.1.2 of spec - A list containing NONE and other types of executables is equivalent to a // list containing the types of executables without NONE. if ( executableTypes.contains( ExecutableType.NONE ) && executableTypes.size() > 1 ) { executableTypes.remove( ExecutableType.NONE ); } // 10.1.2 of spec - A list containing ALL and other types of executables is equivalent to a list containing only ALL if ( executableTypes.contains( ExecutableType.ALL ) ) { executableTypes = ALL_EXECUTABLE_TYPES; } return executableTypes; }