--- old/src/java.base/share/classes/java/lang/String.java 2018-05-09 10:41:57.000000000 -0300 +++ new/src/java.base/share/classes/java/lang/String.java 2018-05-09 10:41:57.000000000 -0300 @@ -2668,7 +2668,8 @@ /** * Returns a string whose value is this string, with all leading - * {@link Character#isWhitespace(int) white space} removed. + * and trailing {@link Character#isWhitespace(int) white space} + * removed. *

* If this {@code String} object represents an empty string, * or if all code points in this string are @@ -2677,14 +2678,16 @@ *

* Otherwise, returns a substring of this string beginning with the first * code point that is not a {@link Character#isWhitespace(int) white space} - * up to to and including the last code point of this string. + * up to and including the last code point that is not a + * {@link Character#isWhitespace(int) white space}. *

- * This method may be used to trim + * This method may be used to strip * {@link Character#isWhitespace(int) white space} from - * the beginning of a string. + * the beginning and end of a string. * - * @return a string whose value is this string, with all leading white - * space removed, or this string if it has no leading white space. + * @return a string whose value is this string, with all leading + * and trailing white space removed, or this string if it + * has no leading or trailing white space. * * @see Character#isWhitespace(int) * @@ -2707,7 +2710,7 @@ *

* Otherwise, returns a substring of this string beginning with the first * code point of this string up to and including the last code point - * that is not a {@link Character#isWhitespace(int) white space}. + * that is not a {@link Character#isWhitespace(int) white space}. *

* This method may be used to trim * {@link Character#isWhitespace(int) white space} from