Validate the {@link org.junit.runners.model.TestClass} and adds reasons
for rejecting the class to a list of errors.

@param target the {@code TestClass} to validate.
@param errors the list of errors.
336543
public void validate(TestClass target, List<Throwable> errors) {
        List<? extends FrameworkMember<?>> members = methods ? target.getAnnotatedMethods(annotation)
                : target.getAnnotatedFields(annotation);

        for (FrameworkMember<?> each : members) {
            validateMember(each, errors);
        }
    }
170779
public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new com.amazonaws.internal.SdkInternalList<ValidationError>(validationErrors);
    }
1093884
@Override
	public List<ParsingError> doValidate() {

		List<ParsingError> result = new ArrayList<> ();
		if( Utils.isEmptyOrWhitespaces( this.newInstanceName ))
			result.add( error( ErrorCode.CMD_MISSING_INSTANCE_NAME ));
		else if( ! this.newInstanceName.matches( ParsingConstants.PATTERN_FLEX_ID ))
			result.add( error( ErrorCode.CMD_INVALID_INSTANCE_NAME, name( this.newInstanceName )));

		if( ! this.context.instanceExists( this.instancePath )) {
			result.add( error( ErrorCode.CMD_NO_MATCHING_INSTANCE, instance( this.instancePath )));

		} else {
			String parentInstancePath = this.instancePath.replaceFirst( "/[^/]+$", "" );
			String siblingPath = parentInstancePath + "/" + this.newInstanceName;
			if( this.context.instanceExists( siblingPath ))
				result.add( error( ErrorCode.CMD_CONFLICTING_INSTANCE_NAME, conflicting( siblingPath )));
		}

		return result;
	}
1296754
@Override
	public List<ParsingError> doValidate() {

		List<ParsingError> result = new ArrayList<> ();
		if( Utils.isEmptyOrWhitespaces( this.newInstanceName ))
			result.add( error( ErrorCode.CMD_MISSING_INSTANCE_NAME ));
		else if( ! this.newInstanceName.matches( ParsingConstants.PATTERN_FLEX_ID ))
			result.add( error( ErrorCode.CMD_INVALID_INSTANCE_NAME ));

		if( ! this.context.instanceExists( this.replicatedInstancePath ))
			result.add( error( ErrorCode.CMD_NO_MATCHING_INSTANCE, instance( this.replicatedInstancePath )));
		else if( InstanceHelpers.countInstances( this.replicatedInstancePath ) > 1 )
			result.add( error( ErrorCode.CMD_NOT_A_ROOT_INSTANCE, instance( this.replicatedInstancePath )));

		return result;
	}
976810
public void setTargets(java.util.Collection<TargetDescription> targets) {
        if (targets == null) {
            this.targets = null;
            return;
        }

        this.targets = new java.util.ArrayList<TargetDescription>(targets);
    }
1324312
public void setErrors(java.util.Collection<SnapshotErrorMessage> errors) {
        if (errors == null) {
            this.errors = null;
            return;
        }

        this.errors = new com.amazonaws.internal.SdkInternalList<SnapshotErrorMessage>(errors);
    }
421450
public void setValidationStatuses(java.util.Collection<AlgorithmStatusItem> validationStatuses) {
        if (validationStatuses == null) {
            this.validationStatuses = null;
            return;
        }

        this.validationStatuses = new java.util.ArrayList<AlgorithmStatusItem>(validationStatuses);
    }
236227
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		if (isParseable()) {
			super.validateComponent(diags);
			validateDate(diags);
		} else {
			diags.add(createErrorDiagnostic(getComponentModel().errorMessage, this));
		}
	}
1365753
public void addConfiguredTarget(final TargetDef target) {
    if (target == null) {
      throw new NullPointerException("target");
    }
    target.setProject(getProject());
    this.targetPlatforms.addElement(target);
  }
1171055
function(target){
            // skip valid type check if value evaluating to false or empty array.
            if(!this.validTypes || !this.validTypes.length){
                return true;
            }

            for(var i = this.validTypes.length - 1; i >= 0; i--){
                var type = this.validTypes[i];
                if(target instanceof type){
                    return true;
                }
            }

            // no valid type match found
            return false;
        }
602950
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public static void validateVoid(Method method, List<Throwable> errors)
    {
        if (method.getReturnType() != Void.TYPE)
        {
            errors.add(new Exception("Method " + method.getName() + "() should be void"));
        }
    }
1175311
public void removeTarget(T target) {
    Iterator<Pattern<T>> it = patterns.iterator();
    while (it.hasNext()) {
      Pattern<T> pattern = it.next();
      if (pattern.target().equals(target)) it.remove();
    }

    reverse.remove(target);
  }
830290
public void setValidUpgradeTarget(java.util.Collection<UpgradeTarget> validUpgradeTarget) {
        if (validUpgradeTarget == null) {
            this.validUpgradeTarget = null;
            return;
        }

        this.validUpgradeTarget = new com.amazonaws.internal.SdkInternalList<UpgradeTarget>(validUpgradeTarget);
    }
604957
protected void validateSTG(){
		if(this.stg==null){
			throw new IllegalArgumentException("stg is null");
		}

		STGroupValidator stgv = new STGroupValidator(this.stg, MessageRenderer.STG_CHUNKS);
		if(stgv.getValidationErrors().hasErrors()){
			throw new IllegalArgumentException(stgv.getValidationErrors().render());
		}
	}
348959
public void setTarget(java.lang.String target) {
        getStateHelper().put(PropertyKeys.target, target);
    }
735436
static void validateAll( Map<String,String> targetProperties, String appName, String instanceName )
	throws TargetException {

		// Basic checks
		validate( targetProperties );

		// Storage checks
		Set<String> mountPoints = new HashSet<> ();
		Set<String> volumeNames = new HashSet<> ();
		for( String s : findStorageIds( targetProperties )) {

			// Unit tests should guarantee there is a default value for the "mount point".
			String mountPoint = findStorageProperty( targetProperties, s, VOLUME_MOUNT_POINT_PREFIX );
			if( mountPoints.contains( mountPoint ))
				throw new TargetException( "Mount point '" + mountPoint + "' is already used by another volume for this VM." );

			mountPoints.add( mountPoint );

			// Same thing for the volume name
			String volumeName = findStorageProperty( targetProperties, s, VOLUME_NAME_PREFIX );
			volumeName = expandVolumeName( volumeName, appName, instanceName );
			if( volumeNames.contains( volumeName ))
				throw new TargetException( "Volume name '" + volumeName + "' is already used by another volume for this VM." );

			volumeNames.add( volumeName );

			// Validate volume size
			String volumesize = findStorageProperty( targetProperties, s, VOLUME_SIZE_GB_PREFIX );
			try {
				Integer.valueOf( volumesize );

			} catch( NumberFormatException e ) {
				throw new TargetException( "The volume size must be a valid integer.", e );
			}
		}
	}
1244773
public void addError(ValidationError error) {
        if (CollectionUtil.isEmpty(errors)) {
            errors = CollectionUtil.createArrayList(Const.INITIAL_CAPACITY);
        }
        errors.add(error);
    }