Get an entry from the interpreter Cache (indexed by JMF encoding version).

@param version the JMF encoding version
978733
public Object getInterpreterCache(int version) {
    if (interpCache != null && version <= interpCache.length)
      return interpCache[version - 1];
    else
      return null;
  }
628244
public static Version parseMavenVersion(String version) {
		if (Strings.isNullOrEmpty(version)) {
			return new Version(0, 0, 0);
		}

		// Detect the snapshot
		final boolean isSnapshot;
		final String coreVersion;
		Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher(version);
		if (matcher.matches()) {
			coreVersion = matcher.group(1);
			isSnapshot = true;
		} else {
			matcher = SNAPSHOT_VERSION_PATTERN.matcher(version);
			if (matcher.matches()) {
				coreVersion = matcher.group(1);
				isSnapshot = true;
			} else {
				coreVersion = version;
				isSnapshot = false;
			}
		}

		// Parse the numbers
		final String[] parts = coreVersion.split("[.]"); //$NON-NLS-1$
		final int[] numbers = new int[] {0, 0, 0};
		int i = 0;
		while (i < numbers.length && i < parts.length) {
			try {
				numbers[i] = Integer.parseInt(parts[i]);
				++i;
			} catch (Exception exception) {
				// Force the exit of the loop since a number cannot be find.
				i = numbers.length;
			}
		}
		// Reply
		if (isSnapshot) {
			return new Version(numbers[0], numbers[1], numbers[2], SNAPSHOT_QUALIFIER);
		}
		return new Version(numbers[0], numbers[1], numbers[2]);
	}
927391
public static VersionNumber parseVersion(@Nonnull final String version) {
		return VersionParser.parseVersion(Check.notNull(version, "version"));
	}
914412
private static AvailEntry getAvailEntry(String key, ClassLoader loader) {
        return GET_AVAILABLE_CACHE.getInstance(key, loader);
    }
1033840
private static String getVersionFromVerFile() throws IOException {
        //declared in a try-with-resource statement, it will be closed regardless of it completes normally or not
        try (BufferedReader br = new BufferedReader(new InputStreamReader(DoradusServer.class.getResourceAsStream("/" + VERSION_FILE), "UTF-8"))) {
            return br.readLine();
        }

    }
769473
public void setJavaSourceVersion(String version) {
		final JavaVersion javaVersion = JavaVersion.fromQualifier(version);
		if (javaVersion == null) {
			final List<String> qualifiers = new ArrayList<>();
			for (final JavaVersion vers : JavaVersion.values()) {
				qualifiers.addAll(vers.getAllQualifiers());
			}

			throw new RuntimeException(MessageFormat.format(
					Messages.SarlBatchCompiler_0, version, Joiner.on(Messages.SarlBatchCompiler_1).join(qualifiers)));
		}
		getGeneratorConfig().setJavaSourceVersion(javaVersion);
	}
441320
public byte[] toBytes(JDKVersion version) {
        ClassNode node = new ClassNode();
        node.version = version.getVer();
        node.access = this.access | ACC_SUPER;
        node.name = this.className;
        node.superName = this.superClassName;
        node.sourceFile = this.sourceFile;
        node.sourceDebug = this.sourceDebug;

        if (parentClassName != null) {
            node.visitOuterClass(parentClassName, null, null);
        }

        for (ChildEntry child : childClasses) {
            node.visitInnerClass(child.getClassName(), className, child.getInnerName(), child.getAccess());
        }

        if (!this.interfaces.isEmpty()) {
            node.interfaces.addAll(this.interfaces);
        }

        for (MethodDefinition def : methods) {
            node.methods.add(def.getMethodNode());
        }

        for (FieldDefinition def : fields) {
            node.fields.add(def.getFieldNode());
        }

        if (node.visibleAnnotations == null) {
            node.visibleAnnotations = new ArrayList<AnnotationNode>();
        }

        for (VisibleAnnotation a : annotations) {
            node.visibleAnnotations.add(a.getNode());
        }

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
        node.accept(cw);
        return cw.toByteArray();
    }
1022836
@Override
    public void setVersion(String version) {
        try {
            this.message.setVersion(version);
        } catch (UnsupportedProtocolVersionException e) {
            this.message.setVersion(VersionValues.V11);
        }
    }
338657
public Release getLanguageVersion() throws CoreException
	{
		if (!hasBuilder())
			return Release.DEFAULT;
		else
		{
			Object languageVersion = getBuilderArguemnt(LANGUAGE_VERSION_ARGUMENT_KEY);
			if (languageVersion != null
					&& Release.lookup(languageVersion.toString()) != null)
				return Release.lookup(languageVersion.toString());

		}
		return Release.DEFAULT;
	}
1273441
public static Version copy(Version version) {
        if (version == null) {
            return null;
        }
        Version result = new Version();
        result.labels = new LinkedList<String>(version.labels);
        result.numbers = new LinkedList<Integer>(version.numbers);
        result.snapshot = version.snapshot;
        return result;
    }
854172
public static int getJavaMajorVersion() {

        final String[] versionElements = System.getProperty(JAVA_VERSION_PROPERTY).split("\\.");
        final int[] versionNumbers = new int[versionElements.length];

        for (int i = 0; i < versionElements.length; i++) {
            try {
                versionNumbers[i] = Integer.parseInt(versionElements[i]);
            } catch (NumberFormatException e) {
                versionNumbers[i] = 0;
            }
        }

        /*
        Java versions 1 - 8 (i.e. jdk 1.1 through 1.8) yields the structure 1.8
        Java versions 9 - yields the structure 10

        JDK 10
        ======
        [java.specification.version]: 10

        JDK 8
        =====
        [java.specification.version]: 1.8

        JDK 7
        =====
        [java.specification.version]: 1.7
        */
        return versionNumbers[0] == 1 ? versionNumbers[1] : versionNumbers[0];
    }
262325
public com.google.appengine.v1.VersionOrBuilder getVersionsOrBuilder(
      int index) {
    return versions_.get(index);
  }
447816
public static String getDisplayVersion(String version, Locale locale) {

        int ver = Integer.parseInt(version);
        if (ver == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) {
            return Messages.get().getBundle(locale).key(Messages.GUI_PROJECT_OFFLINE_0);
        }
        if (ver < 0) {
            ver *= -1;
            if (locale != null) {
                return Messages.get().getBundle(locale).key(Messages.GUI_PROJECT_ONLINE_1, new Integer(ver));
            }
        }
        return "" + ver;
    }
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]);
        }
    }
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;
  }
37317
public static int getVersion(String version) {

        int ver = Integer.parseInt(version);
        return Math.abs(ver);
    }
1239438
public VersionResource getVersion(String name) throws RepositoryException, IllegalResourceTypeException
   {
      return new VersionResource(versionURI(name), versionedResource, versionHistory.getVersion(name), namespaceContext);
   }