< prev index next >

src/java.base/share/classes/java/lang/Runtime.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -953,11 +953,11 @@
      *
      * <h2><a name="verNum">Version numbers</a></h2>
      *
      * <p> A <em>version number</em>, {@code $VNUM}, is a non-empty sequence
      * of elements separated by period characters (U+002E).  An element is
-     * either zero, or a unsigned integer numeral without leading zeros.  The
+     * either zero, or an unsigned integer numeral without leading zeros.  The
      * final element in a version number must not be zero.  The format is:
      * </p>
      *
      * <blockquote><pre>
      *     ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$

@@ -1051,12 +1051,12 @@
      * the case of an {@code internal} build this will often contain the date
      * and time of the build. </p>
      *
      * </ul>
      *
-     * <p> A version number {@code 10-ea} matches {@code $VNUM = "10"} and
-     * {@code $PRE = "ea"}.  The version number {@code 10+-ea} matches
+     * <p> A version string {@code 10-ea} matches {@code $VNUM = "10"} and
+     * {@code $PRE = "ea"}.  The version string {@code 10+-ea} matches
      * {@code $VNUM = "10"} and {@code $OPT = "ea"}. </p>
      *
      * <p> When comparing two version strings, the value of {@code $OPT}, if
      * present, may or may not be significant depending on the chosen
      * comparison method.  The comparison methods {@link #compareTo(Version)

@@ -1245,11 +1245,11 @@
 
         /**
          * Compares this version to another.
          *
          * <p> Each of the components in the <a href="#verStr">version</a> is
-         * compared in the follow order of precedence: version numbers,
+         * compared in the following order of precedence: version numbers,
          * pre-release identifiers, build numbers, optional build information.
          * </p>
          *
          * <p> Comparison begins by examining the sequence of version numbers.
          * If one sequence is shorter than another, then the missing elements

@@ -1373,13 +1373,13 @@
         private int compareBuild(Version ob) {
             Optional<Integer> oBuild = ob.build();
             if (oBuild.isPresent()) {
                 return (build.isPresent()
                         ? build.get().compareTo(oBuild.get())
-                        : 1);
+                        : -1);
             } else if (build.isPresent()) {
-                return -1;
+                return 1;
             }
             return 0;
         }
 
         private int compareOptional(Version ob) {

@@ -1459,11 +1459,11 @@
          * @param  ob
          *         The object to which this {@code Version} is to be compared
          *
          * @return  {@code true} if, and only if, the given object is a {@code
          *          Version} that is identical to this {@code Version}
-         *          ignoring the optinal build information
+         *          ignoring the optional build information
          *
          */
         public boolean equalsIgnoreOptional(Object ob) {
             if (this == ob)
                 return true;
< prev index next >