cast a lucee string version to a int version

@param version
@return int version
422240
public static Version toVersion(String version, final Version defaultValue) {
	// remove extension if there is any
	final int rIndex = version.lastIndexOf(".lco");
	if (rIndex != -1) version = version.substring(0, rIndex);

	try {
	    return Version.parseVersion(version);
	}
	catch (final IllegalArgumentException iae) {
	    return defaultValue;
	}
    }
764511
public void setCompileVersion(String version) {
        if (version == null || ClassUtils.isBeforeJava6(version)) {
            JavassistCompiler javassistCompiler = new JavassistCompiler();
            javassistCompiler.setLogger(logger);
            javassistCompiler.setCodeDirectory(codeDirectory);
            compiler = javassistCompiler;
        } else {
            JdkCompiler jdkCompiler = new JdkCompiler();
            jdkCompiler.setCompileVersion(version);
            jdkCompiler.setLogger(logger);
            jdkCompiler.setCodeDirectory(codeDirectory);
            compiler = jdkCompiler;
        }
    }
75451
public static String fixVersion(String version)
    {
        if (version != null)
            if (version.length() > 0)
        {
            version = version.toUpperCase();
            if (Character.isLetter(version.charAt(0)))
                version = version.substring(1, version.length()) + version.substring(0, 1); // Move letter to start
        }
        return version;
    }
227409
String processVersion(String version) {
    if (version == null || version.trim().isEmpty() || version.equals(APPENGINE_CONFIG)) {
      throw new IllegalArgumentException(VERSION_ERROR);
    } else if (version.equals(GCLOUD_CONFIG)) {
      return null;
    }
    return version;
  }
928513
private Version getSimpleVersion(String product) {
        final Tuple coreNumbers;
        try {
            final TypedQuery<Tuple> coreNumbersQuery =
                    this.createQuery(this.findCoreVersionNumbers);
            coreNumbersQuery.setParameter(this.productParameter, product);
            coreNumbers = DataAccessUtils.singleResult(coreNumbersQuery.getResultList());
        } catch (SQLGrammarException e) {
            logger.warn("UP_VERSION table doesn't exist, returning null for version of " + product);
            return null;
        }

        if (coreNumbers == null) {
            // Table exists but no version data for the product
            return null;
        }

        // Pull out the maj/min/pat values
        final Integer major =
                coreNumbers.get(
                        VersionImpl_.major.getName(), VersionImpl_.major.getBindableJavaType());
        final Integer minor =
                coreNumbers.get(
                        VersionImpl_.minor.getName(), VersionImpl_.minor.getBindableJavaType());
        final Integer patch =
                coreNumbers.get(
                        VersionImpl_.patch.getName(), VersionImpl_.patch.getBindableJavaType());

        // See if the optional local version value exists
        Integer local;
        try {
            final TypedQuery<Integer> localNumberQuery =
                    this.createQuery(this.findLocalVersionNumber);
            localNumberQuery.setParameter(this.productParameter, product);
            local = DataAccessUtils.singleResult(localNumberQuery.getResultList());
        } catch (PersistenceException e) {
            local = null;
        }

        return new VersionImpl(product, major, minor, patch, local);
    }
365193
Integer getVersionOrThrow(CMAResource resource, String action) {
    final Integer version = resource.getVersion();
    if (version == null) {
      throw new IllegalArgumentException(String.format(
          "Cannot perform %s action on a resource that has no version associated.",
          action));
    }
    return version;
  }
844860
public Integer getCountAtOrAbove(final long version) {
        if (versionsStored < versionWindow.length) {
            return null;
        }
        int count = 0;
        for (int versionIdx = 0; versionIdx < versionWindow.length; versionIdx++) {
            if (versionWindow[versionIdx] >= version) {
                count++;
            }
        }

        return count;
    }
1283063
public static function fromString(string $version) : Version
    {
        $patternMajor      = '(?P<major>[0-9]+)';
        $patternMinor      = '(?P<minor>[0-9]+)';
        $patternPatch      = '(?P<patch>[0-9]+)';
        $patternPreRelease = '(?:-(?P<prerelease>(?:[0-9A-Za-z-]+\.)*(?:[0-9A-Za-z-]+)))?';
        $patternBuild      = '(?:\+(?P<build>(?:[0-9A-Za-z-]+\.)*(?:[0-9A-Za-z-]+)))?';

        $pattern = '#^'.$patternMajor.'\.'.$patternMinor.'\.'.$patternPatch.$patternPreRelease.$patternBuild.'$#';
        if (!preg_match($pattern, $version, $matches)) {
            throw new InvalidArgumentException(sprintf('The string "%s" does not look like a version.', $version));
        }

        return new static(
            (int) $matches['major'],
            (int) $matches['minor'],
            (int) $matches['patch'],
            $matches['prerelease'] ?? '',
            $matches['build'] ?? ''
        );
    }
101785
public static boolean isValidVersion(final String version) {
        return StringUtils.isNotBlank(version)
                && (ALTERNATE_PATTERN.matcher(version).matches() || STANDARD_PATTERN
                        .matcher(version).matches());
    }
338910
public MockitoBundlesOption version( final String version )
    {
        ( (MavenArtifactUrlReference) ( (WrappedUrlProvisionOption) getDelegate() ).getUrlReference() ).version(
            version
        );
        return this;
    }
746763
public final int getVersion(final int familyId)
	{
		for (int i = 0; i < ids.length; i++) {
			if (ids[i] == familyId)
				return versions[i];
		}
		return 0;
	}
1195618
private Version versionOf(int major, int minor, int patch) {
    return Version.forIntegers(major, minor, patch);
  }
797559
public static int getVersionAsInteger() {
        StringTokenizer stk = new StringTokenizer(revNumber);
        String release = null;
        for (int i=0 ; stk.hasMoreTokens() ; i++) {
            String s = stk.nextToken();
            if (i==1) {
                release = s;
                break;
            }
        }
        stk = new StringTokenizer(release, ".");
        release = "";
        while (stk.hasMoreTokens()) {
            release += stk.nextToken();
        }
        int version = 0;
        try {
            version = Integer.parseInt(release);
        } catch (NumberFormatException e) {
            //
        }
        return version;
    }
171919
public static String cleanupVersion(String version) {
        StringBuilder result = new StringBuilder();
        Matcher m = FUZZY_VERSION.matcher(version);
        if (m.matches()) {
            String major = m.group(1);
            String minor = m.group(3);
            String micro = m.group(5);
            String qualifier = m.group(7);

            if (major != null) {
                result.append(major);
                if (minor != null) {
                    result.append(".");
                    result.append(minor);
                    if (micro != null) {
                        result.append(".");
                        result.append(micro);
                        if (qualifier != null) {
                            result.append(".");
                            cleanupModifier(result, qualifier);
                        }
                    } else if (qualifier != null) {
                        result.append(".0.");
                        cleanupModifier(result, qualifier);
                    } else {
                        result.append(".0");
                    }
                } else if (qualifier != null) {
                    result.append(".0.0.");
                    cleanupModifier(result, qualifier);
                } else {
                    result.append(".0.0");
                }
            }
        } else {
            result.append("0.0.0.");
            cleanupModifier(result, version);
        }
        return result.toString();
    }
968748
private void parse(String version) {
        String[] tokens = StringUtil.tokenizeVersionString(version);
        this.major = Byte.valueOf(tokens[0]);
        this.minor = Byte.valueOf(tokens[1]);
        if (tokens.length > 3 && tokens[3] != null) {
            this.patch = Byte.valueOf(tokens[3]);
        }
    }
774004
public static Version parseVersion(String version) {
		if (!Strings.isNullOrEmpty(version)) {
			try {
				return Version.parseVersion(version);
			} catch (Throwable exception) {
				//
			}
		}
		return null;
	}
1338451
static int getMajorJavaVersion(String javaVersion) {
    int version = parseDotted(javaVersion);
    if (version == -1) {
      version = extractBeginningInt(javaVersion);
    }
    if (version == -1) {
      return 6;  // Choose minimum supported JDK version as default
    }
    return version;
  }