This method gets the Version of this program.

@return the program-version.
429625
protected String getVersion() {

    Manifest manifest = ManifestLoader.loadManifest(getClass());
    String versionNumber = null;
    if (manifest != null) {
      versionNumber = ManifestLoader.getValue(manifest, Attributes.Name.IMPLEMENTATION_VERSION);
      if (versionNumber == null) {
        versionNumber = ManifestLoader.getValue(manifest, Attributes.Name.SPECIFICATION_VERSION);
      }
    }
    if (versionNumber == null) {
      versionNumber = SNAPSHOT;
    }
    return versionNumber;
  }
1318978
public static Version version() {
    final IntByReference major = new IntByReference();
    final IntByReference minor = new IntByReference();
    final IntByReference patch = new IntByReference();

    LIB.mdb_version(major, minor, patch);

    return new Version(major.intValue(), minor.intValue(), patch.
                       intValue());
  }
476473
public com.google.appengine.v1.Version getVersion() {
    return version_ == null ? com.google.appengine.v1.Version.getDefaultInstance() : version_;
  }
363395
public static String getRuntimeVersion() throws IOException {
        String classLoc = ClasspathUtil.locate(MdwVersion.class.getName());
        int dotJarBang = classLoc.lastIndexOf(".jar!");
        if (dotJarBang > 0) {
            String jarFilePath = classLoc.substring(0, dotJarBang + 4);
            if (jarFilePath.startsWith("file:/"))
                jarFilePath = jarFilePath.substring(6);
            if (!jarFilePath.startsWith("/"))
                jarFilePath = "/" + jarFilePath;
            try (JarFile jarFile = new JarFile(new File(jarFilePath))) {
                Manifest manifest = jarFile.getManifest();
                String version = manifest.getMainAttributes().getValue("MDW-Version");
                String buildTimestamp = manifest.getMainAttributes().getValue("MDW-Build");
                return version + " " + buildTimestamp;
            }
        }
        return null;
    }
1220430
public VersionComparator getSchemaVersion() {
        PreparedStatement statement = null;
        ResultSet results = null;
        try {
            statement = connection.prepareStatement("SELECT \"VERSION\" FROM \"SCHEMAVERSION\"");
            results = statement.executeQuery();

            if (results.next()) {
                return new VersionComparator(results.getString(1));
            }
        } catch (SQLException e) {
            // throw it away
        } finally {
            DbUtil.close(results);
            DbUtil.close(statement);
            //DbUtil.close(connection); // do not close connection
        }
        return null;
    }
376256
public static String getVersion() {

        String FATHOM_PROPERTIES = "fathom/version.properties";
        String version = null;

        URL url = ClassUtil.getResource(FATHOM_PROPERTIES);
        Preconditions.checkNotNull(url, "Failed to find " + FATHOM_PROPERTIES);

        try (InputStream stream = url.openStream()) {
            Properties prop = new Properties();
            prop.load(stream);

            version = prop.getProperty("version");

        } catch (IOException e) {
            LoggerFactory.getLogger(Constants.class).error("Failed to read '{}'", FATHOM_PROPERTIES, e);
        }

        Preconditions.checkNotNull(version, "The Fathom version is null!");

        return version;
    }
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];
    }
772453
public java.lang.String getVersion() {
    java.lang.Object ref = version_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        version_ = s;
      }
      return s;
    }
  }
926218
public static String getAppVersion() {
        if (appVersion != null)
            return appVersion;

        String appName = getAppId();
        if ("mdw".equalsIgnoreCase(appName)) {
            appVersion = getMdwVersion();
        }
        else {
            appVersion = "Unknown";
            try {
                InputStream stream = ApplicationContext.class.getClassLoader().getResourceAsStream(BUILD_VERSION_FILE);
                if (stream != null) {
                    appVersion = "";
                    int i;
                    while ((i = stream.read()) != -1) {
                        appVersion += (char) i;
                    }
                    stream.close();
                }
            }
            catch (Exception ex) {
                logger.severeException(ex.getMessage(), ex);
            }
        }

        return appVersion;
    }
584476
public function getVersion()
    {
        if ($package = $this->getComposerInstall()) {
            if ($package->version === 'dev-master') {
                return 'dev-master (' . substr($package->source->reference, 0, 8) . ')';
            }
            return 'v' . $package->version;
        }
        return 'v' . self::$VERSION;
    }
622160
public static String getJavaTargetVersionFromPom() {
        try {
            Properties properties = new Properties();
            ClassLoader classLoader = ClassLoader.getSystemClassLoader();
            properties.load(classLoader.getResourceAsStream("project.properties"));
            return "" + properties.getProperty("targetJavaVersion");
        } catch (Exception ex) {
            return "";
        }
    }
435097
@Override
    public VersionInfo getUCAVersion() {
        VersionInfo v = getVersion();
        // Note: This is tied to how the current implementation encodes the UCA version
        // in the overall getVersion().
        // Alternatively, we could load the root collator and get at lower-level data from there.
        // Either way, it will reflect the input collator's UCA version only
        // if it is a known implementation.
        // (C++ comment) It would be cleaner to make this a virtual Collator method.
        // (In Java, it is virtual.)
        return VersionInfo.getInstance(v.getMinor() >> 3, v.getMinor() & 7, v.getMilli() >> 6, 0);
    }
1312879
public java.lang.String getVersionUrl() {
    java.lang.Object ref = versionUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      versionUrl_ = s;
      return s;
    }
  }
477420
public static int getVersionFromProperties() {
        String ver = version.get();
        if(ver == null) {
            try {
                InputStream resourceAsStream = ProtocolUtil.class.getResourceAsStream("/japi-version.properties");
                Properties props = new Properties();
                props.load( resourceAsStream );

                ver = props.getProperty("build.version");
                Matcher verMatch = versionPattern.matcher(ver);
                if(verMatch.matches() && verMatch.groupCount() == 2) {
                    int major = Integer.parseInt(verMatch.group(1));
                    int minor = Integer.parseInt(verMatch.group(2));
                    return (major * 100) + minor;
                }

            } catch (Exception e) {
                System.getLogger("ProtocolUtil").log(ERROR, "Did not successfully obtain version", e);
            }
        }
        return 0;
    }
981124
public long getVersion() {
    long version = 1;

    ArrayList<String> indices = new ArrayList<>(getIndices().keySet());
    Collections.sort(indices);
    for (String index : indices) {
      version = 31 * version + getIndices().get(index);
    }

    return version;
  }
397519
public static synchronized String getVersion() {
        // Try to get version number from pom.xml (available when running in Eclipse)
        final Class<?> cls = ClassGraph.class;
        try {
            final String className = cls.getName();
            final URL classpathResource = cls.getResource("/" + JarUtils.classNameToClassfilePath(className));
            if (classpathResource != null) {
                final Path absolutePackagePath = Paths.get(classpathResource.toURI()).getParent();
                final int packagePathSegments = className.length() - className.replace(".", "").length();
                // Remove package segments from path
                Path path = absolutePackagePath;
                for (int i = 0; i < packagePathSegments && path != null; i++) {
                    path = path.getParent();
                }
                // Remove up to two more levels for "bin" or "target/classes"
                for (int i = 0; i < 3 && path != null; i++, path = path.getParent()) {
                    final Path pom = path.resolve("pom.xml");
                    try (InputStream is = Files.newInputStream(pom)) {
                        final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
                        doc.getDocumentElement().normalize();
                        String version = (String) XPathFactory.newInstance().newXPath().compile("/project/version")
                                .evaluate(doc, XPathConstants.STRING);
                        if (version != null) {
                            version = version.trim();
                            if (!version.isEmpty()) {
                                return version;
                            }
                        }
                    } catch (final IOException e) {
                        // Not found
                    }
                }
            }
        } catch (final Exception e) {
            // Ignore
        }

        // Try to get version number from maven properties in jar's META-INF directory
        try (InputStream is = cls.getResourceAsStream(
                "/META-INF/maven/" + MAVEN_PACKAGE + "/" + MAVEN_ARTIFACT + "/pom.properties")) {
            if (is != null) {
                final Properties p = new Properties();
                p.load(is);
                final String version = p.getProperty("version", "").trim();
                if (!version.isEmpty()) {
                    return version;
                }
            }
        } catch (final IOException e) {
            // Ignore
        }

        // Fallback to using Java API (version number is obtained from MANIFEST.MF)
        final Package pkg = cls.getPackage();
        if (pkg != null) {
            String version = pkg.getImplementationVersion();
            if (version == null) {
                version = "";
            }
            version = version.trim();
            if (version.isEmpty()) {
                version = pkg.getSpecificationVersion();
                if (version == null) {
                    version = "";
                }
                version = version.trim();
            }
            if (!version.isEmpty()) {
                return version;
            }
        }
        return "unknown";
    }
899686
protected String getVersion(String version) {
        return this.version == null || this.version.length() == 0
                ? version
                : this.version;
    }