/* (non-Javadoc)
@see org.eclipse.ohf.ucum.UcumServiceEx#validateCanonicalUnits(java.lang.String, java.lang.String)
761911
@Override
  public String validateCanonicalUnits(String unit, String canonical) {
		assert checkStringParam(unit) : paramError("validate", "unit", "must not be null or empty");
		assert checkStringParam(canonical) : paramError("validateCanonicalUnits", "canonical", "must not be null or empty");
		try {
			Term term = new ExpressionParser(model).parse(unit);
			Canonical can = new Converter(model, handlers).convert(term);
			String cu = new ExpressionComposer().compose(can, false);
			if (!canonical.equals(cu))
				return "unit "+unit+" has the base units "+cu+", not "+canonical+" as required.";
			return null;
		} catch (Exception e) {
			return e.getMessage();
		}
	}
684660
public final void validate() throws InvalidDependenciesDefinitionException {

        int errorCount = 0;
        final StringBuilder sb = new StringBuilder("Duplicate package entries in 'allowed' and 'forbidden': ");
        final List<Package<NotDependsOn>> list = getForbidden();
        for (int i = 0; i < list.size(); i++) {
            final String name = list.get(i).getName();
            final Package<DependsOn> dep = new Package<DependsOn>(name);
            if (getAllowed().indexOf(dep) > -1) {
                if (errorCount > 0) {
                    sb.append(", ");
                }
                sb.append(name);
                errorCount++;
            }
        }
        if (errorCount > 0) {
            throw new InvalidDependenciesDefinitionException(this, sb.toString());
        }
    }
409139
@Override
	public Set<String> getSupportedAnnotationTypes() {		
		Set<String> result=new HashSet<String>();		
		for (Class<? extends Annotation> annotation: getSupportedAnnotationClasses()) {
			result.add(annotation.getCanonicalName());	
		}
				
		return result;
	}
718062
public void validateAttributes(Collection<String> attributes) throws CompatibilityException {
                Validate.notNull(attributes);
                for (String attribute : attributes) {
                        validateAttribute(attribute);
                }
        }
535310
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		if (isValidNumber()) {
			super.validateComponent(diags);
			validateNumber(diags);
		} else {
			diags.add(createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID, this));
		}
	}
449845
protected void ensureNoInvalidFlags(final String actual, 
                                        final char[] invalid) {
        if (actual == null) return;
        StringBuilder unexpected = null;
        for (int i = 0; i < actual.length(); i++) {
            char c = actual.charAt(i);
            if (oneOf(c, invalid)) {
                if (unexpected == null) unexpected = new StringBuilder();
                unexpected.append(c);
            }
        }
        if (unexpected != null) {
            throw FormatException.formatFlagsMismatch(
                    unexpected.toString(), getFormatName());
        }
    }
306261
void generateValidationChecks(
            final CtClass ctClass,
            final StringBuilder validationChecksCode,
            final StringBuilder staticInitializerCode,
            final List<String> staticFields) {

        for (final CtField ctField : ctClass.getDeclaredFields()) {
            for (final Object annotationObject : ctField.getAvailableAnnotations()) {
                final Annotation annotation = (Annotation) annotationObject;
                if (ANNOTATIONS.contains(annotation.annotationType())) {
                    final Constraint constraint = annotation.annotationType().getAnnotation(Constraint.class);
                    final Class<? extends AnnotationCheck<? extends Annotation>> checkClass = constraint.checkWith();
                    final String checkType = checkClass.getName();
                    final String checkName = getCheckName(ctField.getName(), checkType);
                    final String fieldName = ctField.getName();

                    // Define the member for the check
                    staticFields.add(generateCheckFieldDeclaration(checkType, checkName));

                    // Define the member for the field context
                    staticFields.add(generateFieldContextDeclaration(ctClass.getName(), checkName, fieldName));

                    // Write the check initializer code
                    staticInitializerCode.append(
                            generateCheckInitializer(
                                    ctClass.getName(),
                                    checkName,
                                    fieldName,
                                    annotation.annotationType().getName()));

                    // Write the validation code
                    validationChecksCode.append(generateValidation(
                            annotation,
                            checkType,
                            checkName,
                            fieldName));
                }
            }
        }
    }
1073193
public List<String> validateUniques(Identifiable<?> entity) {
        return newArrayList(concat( //
                validateCompositeUniqueConstraints(entity), //
                validateSimpleUniqueConstraints(entity) //
        ));
    }
1247687
@com.fasterxml.jackson.annotation.JsonProperty("validationErrors")
    public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new java.util.ArrayList<ValidationError>(validationErrors);
    }
39109
private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final TriggerDependencyBean dep : dependencies) {
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getName()), String.format("duplicate dependency"
          + ".name %s found, dependency.name should be unique", dep.getName()));
    }
  }
196972
public String getCanonical() {
    if (BioVerb_Type.featOkTst && ((BioVerb_Type)jcasType).casFeat_canonical == null)
      jcasType.jcas.throwFeatMissing("canonical", "ch.epfl.bbp.uima.types.BioVerb");
    return jcasType.ll_cas.ll_getStringValue(addr, ((BioVerb_Type)jcasType).casFeatCode_canonical);}
386530
@Override
  public final boolean isValid(final String pvalue, final ConstraintValidatorContext pcontext) {
    if (StringUtils.isEmpty(pvalue)) {
      return true;
    }
    return charsetEncoder.canEncode(pvalue);
  }
1056379
private void validateFields() throws RepositoryConfigException {
        try {
            /*
             * Ontology file
             */
            if (owlFile
                    .filter(f -> !f.exists())
                    .isPresent()) {
                throw new RepositoryConfigException(String.format("The OWL file %s does not exist!",
                        owlFile.get().getAbsolutePath()));
            }
            if (owlFile
                    .filter(f -> !f.canRead())
                    .isPresent()) {
                throw new RepositoryConfigException(String.format("The OWL file %s is not accessible!",
                        owlFile.get().getAbsolutePath()));
            }

            /*
             * Mapping file
             */
            if (obdaFile == null) {
                throw new RepositoryConfigException(String.format("No mapping file specified for repository creation "));
            }
            if (!obdaFile.exists()) {
                throw new RepositoryConfigException(String.format("The mapping file %s does not exist!",
                        obdaFile.getAbsolutePath()));
            }
            if (!obdaFile.canRead()) {
                throw new RepositoryConfigException(String.format("The mapping file %s is not accessible!",
                        obdaFile.getAbsolutePath()));
            }

            /*
             * Properties file
             */

            if (propertiesFile == null) {
                throw new RepositoryConfigException(String.format("No properties file specified for repository creation "));
            }
            if (!propertiesFile.exists()) {
                throw new RepositoryConfigException(String.format("The properties file %s does not exist!",
                        propertiesFile.getAbsolutePath()));
            }
            if (!propertiesFile.canRead()) {
                throw new RepositoryConfigException(String.format("The properties file %s is not accessible!",
                        propertiesFile.getAbsolutePath()));
            }

            if (constraintFile.isPresent()) {
                File file = constraintFile.get();
                if (!file.exists()) {
                    throw new RepositoryConfigException(String.format("The implicit key file %s does not exist!",
                            file.getAbsolutePath()));
                }
                if (!file.canRead()) {
                    throw new RepositoryConfigException(String.format("The implicit key file %s is not accessible!",
                            file.getAbsolutePath()));
                }
            }
        }
        /*
         * Sometimes thrown when there is no access right to the files.
         */
        catch (SecurityException e) {
            throw new RepositoryConfigException(e.getMessage());
        }
    }
247723
private void validateTypeNotIn(TypeMirror t, Set<TypeKind> invalidKinds) {
        if (invalidKinds.contains(t.getKind()))
            throw new IllegalArgumentException(t.toString());
    }
1213293
public static String toCanonicalForm(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.CANONICAL_NORMALIZATION.apply(input.toString());
   }
874988
@Override
	public String toCanonicalString() {
		String result;
		if(hasNoStringCache() || (result = getStringCache().canonicalString) == null) {
			getStringCache().canonicalString = result = toNormalizedString(MACStringCache.canonicalParams);
		}
		return result;
	}
105565
protected boolean hasAllCanonicalTypes() {
        if (types.length==0) return false;
        for (String typeName : types) {
            InternalRelationType type = QueryUtil.getType(tx, typeName);
            if (type!=null && !type.isPropertyKey() && !type.multiplicity().isUnique(dir)) return false;
        }
        return true;
    }