Validates an version.
@param name
@throws InvalidNameException
355528
public static void validateVersion(String name) throws InvalidNameException {
        if (StringUtils.isEmpty(name)) {
            throw ExceptionFactory.invalidVersionException(Messages.i18n.format("FieldValidator.EmptyVersionError")); //$NON-NLS-1$
        }
    }
1283651
public void claimName(String name) {
    checkName(name);
    if (names.add(name, 1) != 0) {
      names.remove(name);
      // give a slightly better error message in this case
      if (reserved.contains(name)) {
        throw new IllegalArgumentException("Tried to claim a reserved name: " + name);
      }
      throw new IllegalArgumentException("Name: " + name + " was already claimed!");
    }
  }
820414
@Override
    public boolean validateName(String name) {
        return name != null && !name.isEmpty() && StringUtils.isAlphanumericSpace(name.replace('_', ' '));
    }
1044787
public static ErrorCode isNameValid(String name) {
        if (!isMustFieldValid(name, nameRegEx)) {
            return ErrorCode.SERVICE_INSTANCE_NAME_FORMAT_ERROR;
        }
        return ErrorCode.OK;
    }
251185
public static void checkForValidName(final Node node, final String name)
    {
        if (!ValidationUtil.isSbeCppName(name))
        {
            handleWarning(node, "name is not valid for C++: " + name);
        }

        if (!ValidationUtil.isSbeJavaName(name))
        {
            handleWarning(node, "name is not valid for Java: " + name);
        }

        if (!ValidationUtil.isSbeGolangName(name))
        {
            handleWarning(node, "name is not valid for Golang: " + name);
        }

        if (!ValidationUtil.isSbeCSharpName(name))
        {
            handleWarning(node, "name is not valid for C#: " + name);
        }
    }
314098
public void setVerifyContainNames(String names) {
                if (!GitTaskUtils.isNullOrBlankString(names)) {
                        namesToCheck.addAll(Arrays.asList(names.split(",")));
                }
                else {
                        throw new BuildException("Invalid references names.");
                }
        }
211286
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var handler =  _.find(this.commandHandlers, function (cmdHnd) {
      return cmdHnd.name === name && cmdHnd.version === version;
    });

    if (handler) {
      return handler;
    }

    if (!this.getCommand(name, version)) {
      return null;
    }

    return this.defaultCommandHandler;
  }
285808
private static boolean validTemplateTypeName(String name) {
    return !name.isEmpty()
        && CharMatcher.javaLetterOrDigit().or(CharMatcher.is('_')).matchesAllOf(name);
  }
1362850
public static boolean charValidate(String name) {
        if (name.matches("[0-9]+") || name.toLowerCase().equals("null")) {
            return false;
        } else {
            return name.matches("[a-zA-Z0-9-_.]+");
        }
    }
738627
protected function validateName($name = null)
    {
        if (null == $name) {
            $name = $this->name;
        }

        if (strlen($name) > OBJECT_NAME_LIMIT) {
            throw new Exceptions\InvalidObjectName();
        }
    }
505634
protected function validateName($name)
    {
        if (!ApiKey::isValidName($name)) {
            return self::MESSAGE_ERROR_INVALID_NAME;
        }
        if (!ApiKey::nameExists($name)) {
            return self::MESSAGE_ERROR_NAME_DOES_NOT_EXIST;
        }
        return null;
    }
1246098
public void validate() {
        // check if android build tool version is at least minimal required version
        Revision revBuildToolsVersion = Revision.parseRevision(buildToolsVersion);
        if (minimalBuildToolsVersion.compareTo(revBuildToolsVersion) > 0) {
            throw new GradleException("Android buildToolsVersion should be at least version " + minimalBuildToolsVersion + ": currently using " + buildToolsVersion + " from " + buildToolsDir + ". See https://developer.android.com/studio/intro/update.html on how to update the build tools in the Android SDK.");
        }

        // check if valid android build tools exists
        if (!project.file(buildToolsDir + "/aapt").exists() &&
                !project.file(buildToolsDir + "/aapt.exe").exists()) {
            throw new GradleException("Configured buildToolsVersion is invalid: " + buildToolsVersion + " (" + buildToolsDir + ")");
        }

        // check if android platform exists
        if (!project.file(androidSdk + "/platforms/android-" + compileSdkVersion).exists()) {
            throw new GradleException("Configured compileSdkVersion is invalid: " + compileSdkVersion + " (" + androidSdk + "/platforms/android-" + compileSdkVersion + ")");
        }

//        sdkHandler.initTarget(AndroidTargetHash.getPlatformHashString(new AndroidVersion(Integer.parseInt(compileSdkVersion))),
//                getBuildToolsRevision(), Collections.emptyList(), androidBuilder, false);

        sdkHandler.ensurePlatformToolsIsInstalled(extraModelInfo);
    }
59661
private void checkBucketName(String name) throws InvalidBucketNameException {
    if (name == null) {
      throw new InvalidBucketNameException(NULL_STRING, "null bucket name");
    }

    // Bucket names cannot be no less than 3 and no more than 63 characters long.
    if (name.length() < 3 || name.length() > 63) {
      String msg = "bucket name must be at least 3 and no more than 63 characters long";
      throw new InvalidBucketNameException(name, msg);
    }
    // Successive periods in bucket names are not allowed.
    if (name.matches("\\.\\.")) {
      String msg = "bucket name cannot contain successive periods. For more information refer "
          + "http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html";
      throw new InvalidBucketNameException(name, msg);
    }
    // Bucket names should be dns compatible.
    if (!name.matches("^[a-z0-9][a-z0-9\\.\\-]+[a-z0-9]$")) {
      String msg = "bucket name does not follow Amazon S3 standards. For more information refer "
          + "http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html";
      throw new InvalidBucketNameException(name, msg);
    }
  }
255062
protected void validName(String name) throws SyntaxException {
		for (String varName : automaticVariables) {
			if (varName.equals(name)) {
				throw SyntaxException.create(getSourceRange(),
						MSG_AUTO_VAR_CANNOT_BE_SET, varName);
			}
		}
	}
1095129
public void validate(@Nullable String version) {
    if (reportDownloadTimeout != null) {
      Preconditions.checkArgument(
          reportDownloadTimeout >= 0, "Report download timeout is < 0: %s", reportDownloadTimeout);
    }
  }
890887
public void checkVersion(String version) throws ConnectionException {
        MetaModel meta = createMetaModel();
        meta.getAssetType("Member");

        if ((version != null) && (version.length() > 0)
                && ((meta.getVersion() == null) || (meta.getVersion()
                .compareTo(new Version(version)) < 0))) {
            throw new ConnectionException(MessageFormat.format(
                    "VersionOne Release {0} or above is required (found {1}).",
                    version, meta.getVersion()));
        }
    }
1153939
public static function validateReleaseFormat($name)
    {
        self::validateReleaseFormatForHyphen($name);
        list($adjective, $noun) = explode('-', $name);

        if ($adjective[0] != $noun[0]) {
            throw new \Exception('Invalid combination of release name: ' . $name);
        }
    }