--- old/src/java.base/share/classes/java/util/regex/Matcher.java 2015-08-07 21:15:27.602583637 +0400 +++ new/src/java.base/share/classes/java/util/regex/Matcher.java 2015-08-07 21:15:27.394583646 +0400 @@ -258,7 +258,7 @@ * The result is unaffected by subsequent operations performed upon this * matcher. * - * @return a MatchResult with the state of this matcher + * @return a {@code MatchResult} with the state of this matcher * @since 1.5 */ public MatchResult toMatchResult() { @@ -347,7 +347,7 @@ } /** - * Changes the Pattern that this Matcher uses to + * Changes the {@code Pattern} that this {@code Matcher} uses to * find matches with. * *

This method causes this matcher to lose information @@ -359,7 +359,7 @@ * The new pattern used by this matcher * @return This matcher * @throws IllegalArgumentException - * If newPattern is null + * If newPattern is {@code null} * @since 1.5 */ public Matcher usePattern(Pattern newPattern) { @@ -444,14 +444,14 @@ * *

Capturing groups are indexed from left * to right, starting at one. Group zero denotes the entire pattern, so - * the expression m.start(0) is equivalent to - * m.start().

+ * the expression m.{@code start(0)} is equivalent to + * m.{@code start()}.

* * @param group * The index of a capturing group in this matcher's pattern * * @return The index of the first character captured by the group, - * or -1 if the match was successful but the group + * or {@code -1} if the match was successful but the group * itself did not match anything * * @throws IllegalStateException @@ -516,14 +516,14 @@ * *

Capturing groups are indexed from left * to right, starting at one. Group zero denotes the entire pattern, so - * the expression m.end(0) is equivalent to - * m.end().

+ * the expression m.{@code end(0)} is equivalent to + * m.{@code end()}.

* * @param group * The index of a capturing group in this matcher's pattern * * @return The offset after the last character captured by the group, - * or -1 if the match was successful + * or {@code -1} if the match was successful * but the group itself did not match anything * * @throws IllegalStateException @@ -571,11 +571,11 @@ * Returns the input subsequence matched by the previous match. * *

For a matcher m with input sequence s, - * the expressions m.group() and - * s.substring(m.start(), m.end()) + * the expressions m.{@code group()} and + * s.{@code substring(}m.{@code start(),} m.{@code end())} * are equivalent.

* - *

Note that some patterns, for example a*, match the empty + *

Note that some patterns, for example {@code a*}, match the empty * string. This method will return the empty string when the pattern * successfully matches the empty string in the input.

* @@ -595,18 +595,19 @@ * previous match operation. * *

For a matcher m, input sequence s, and group index - * g, the expressions m.group(g) and - * s.substring(m.start(g), m.end(g)) + * g, the expressions m.{@code group(}g{@code )} and + * s.{@code substring(}m.{@code start(}g{@code + * ),} m.{@code end(}g{@code ))} * are equivalent.

* *

Capturing groups are indexed from left * to right, starting at one. Group zero denotes the entire pattern, so - * the expression m.group(0) is equivalent to m.group(). + * the expression {@code m.group(0)} is equivalent to {@code m.group()}. *

* *

If the match was successful but the group specified failed to match - * any part of the input sequence, then null is returned. Note - * that some groups, for example (a*), match the empty string. + * any part of the input sequence, then {@code null} is returned. Note + * that some groups, for example {@code (a*)}, match the empty string. * This method will return the empty string when such a group successfully * matches the empty string in the input.

* @@ -614,7 +615,7 @@ * The index of a capturing group in this matcher's pattern * * @return The (possibly empty) subsequence captured by the group - * during the previous match, or null if the group + * during the previous match, or {@code null} if the group * failed to match part of the input * * @throws IllegalStateException @@ -641,8 +642,8 @@ * match operation. * *

If the match was successful but the group specified failed to match - * any part of the input sequence, then null is returned. Note - * that some groups, for example (a*), match the empty string. + * any part of the input sequence, then {@code null} is returned. Note + * that some groups, for example {@code (a*)}, match the empty string. * This method will return the empty string when such a group successfully * matches the empty string in the input.

* @@ -650,7 +651,7 @@ * The name of a named-capturing group in this matcher's pattern * * @return The (possibly empty) subsequence captured by the named group - * during the previous match, or null if the group + * during the previous match, or {@code null} if the group * failed to match part of the input * * @throws IllegalStateException @@ -689,9 +690,9 @@ * Attempts to match the entire region against the pattern. * *

If the match succeeds then more information can be obtained via the - * start, end, and group methods.

+ * {@code start}, {@code end}, and {@code group} methods.

* - * @return true if, and only if, the entire region sequence + * @return {@code true} if, and only if, the entire region sequence * matches this matcher's pattern */ public boolean matches() { @@ -708,9 +709,9 @@ * match. * *

If the match succeeds then more information can be obtained via the - * start, end, and group methods.

+ * {@code start}, {@code end}, and {@code group} methods.

* - * @return true if, and only if, a subsequence of the input + * @return {@code true} if, and only if, a subsequence of the input * sequence matches this matcher's pattern */ public boolean find() { @@ -737,7 +738,7 @@ * index. * *

If the match succeeds then more information can be obtained via the - * start, end, and group methods, and subsequent + * {@code start}, {@code end}, and {@code group} methods, and subsequent * invocations of the {@link #find()} method will start at the first * character not matched by this match.

* @@ -746,7 +747,7 @@ * If start is less than zero or if start is greater than the * length of the input sequence. * - * @return true if, and only if, a subsequence of the input + * @return {@code true} if, and only if, a subsequence of the input * sequence starting at the given index matches this matcher's * pattern */ @@ -767,9 +768,9 @@ * require that the entire region be matched. * *

If the match succeeds then more information can be obtained via the - * start, end, and group methods.

+ * {@code start}, {@code end}, and {@code group} methods.

* - * @return true if, and only if, a prefix of the input + * @return {@code true} if, and only if, a prefix of the input * sequence matches this matcher's pattern */ public boolean lookingAt() { @@ -777,14 +778,14 @@ } /** - * Returns a literal replacement String for the specified - * String. + * Returns a literal replacement {@code String} for the specified + * {@code String}. * - * This method produces a String that will work - * as a literal replacement s in the - * appendReplacement method of the {@link Matcher} class. - * The String produced will match the sequence of characters - * in s treated as a literal sequence. Slashes ('\') and + * This method produces a {@code String} that will work + * as a literal replacement {@code s} in the + * {@code appendReplacement} method of the {@link Matcher} class. + * The {@code String} produced will match the sequence of characters + * in {@code s} treated as a literal sequence. Slashes ('\') and * dollar signs ('$') will be given no special meaning. * * @param s The string to be literalized @@ -816,7 +817,7 @@ * append position, and appends them to the given string buffer. It * stops after reading the last character preceding the previous match, * that is, the character at index {@link - * #start()} - 1.

+ * #start()} {@code -} {@code 1}.

* *
  • It appends the given replacement string to the string buffer. *

  • @@ -829,21 +830,21 @@ * *

    The replacement string may contain references to subsequences * captured during the previous match: Each occurrence of - * ${name} or $g + * ${name} or {@code $}g * will be replaced by the result of evaluating the corresponding * {@link #group(String) group(name)} or {@link #group(int) group(g)} - * respectively. For $g, - * the first number after the $ is always treated as part of + * respectively. For {@code $}g, + * the first number after the {@code $} is always treated as part of * the group reference. Subsequent numbers are incorporated into g if * they would form a legal group reference. Only the numerals '0' * through '9' are considered as potential components of the group - * reference. If the second group matched the string "foo", for - * example, then passing the replacement string "$2bar" would - * cause "foobar" to be appended to the string buffer. A dollar - * sign ($) may be included as a literal in the replacement - * string by preceding it with a backslash (\$). + * reference. If the second group matched the string {@code "foo"}, for + * example, then passing the replacement string {@code "$2bar"} would + * cause {@code "foobar"} to be appended to the string buffer. A dollar + * sign ({@code $}) may be included as a literal in the replacement + * string by preceding it with a backslash ({@code \$}). * - *

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * the replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and @@ -852,8 +853,8 @@ * *

    This method is intended to be used in a loop together with the * {@link #appendTail appendTail} and {@link #find find} methods. The - * following code, for example, writes one dog two dogs in the - * yard to the standard-output stream:

    + * following code, for example, writes {@code one dog two dogs in the + * yard} to the standard-output stream:

    * *
          * Pattern p = Pattern.compile("cat");
    @@ -911,7 +912,7 @@
          *   append position, and appends them to the given string builder.  It
          *   stops after reading the last character preceding the previous match,
          *   that is, the character at index {@link
    -     *   #start()} - 1.  

    + * #start()} {@code -} {@code 1}.

    * *
  • It appends the given replacement string to the string builder. *

  • @@ -924,19 +925,19 @@ * *

    The replacement string may contain references to subsequences * captured during the previous match: Each occurrence of - * $g will be replaced by the result of - * evaluating {@link #group(int) group}(g). - * The first number after the $ is always treated as part of + * {@code $}g will be replaced by the result of + * evaluating {@link #group(int) group}{@code (}g{@code )}. + * The first number after the {@code $} is always treated as part of * the group reference. Subsequent numbers are incorporated into g if * they would form a legal group reference. Only the numerals '0' * through '9' are considered as potential components of the group - * reference. If the second group matched the string "foo", for - * example, then passing the replacement string "$2bar" would - * cause "foobar" to be appended to the string builder. A dollar - * sign ($) may be included as a literal in the replacement - * string by preceding it with a backslash (\$). + * reference. If the second group matched the string {@code "foo"}, for + * example, then passing the replacement string {@code "$2bar"} would + * cause {@code "foobar"} to be appended to the string builder. A dollar + * sign ({@code $}) may be included as a literal in the replacement + * string by preceding it with a backslash ({@code \$}). * - *

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * the replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and @@ -945,8 +946,8 @@ * *

    This method is intended to be used in a loop together with the * {@link #appendTail appendTail} and {@link #find find} methods. The - * following code, for example, writes one dog two dogs in the - * yard to the standard-output stream:

    + * following code, for example, writes {@code one dog two dogs in the + * yard} to the standard-output stream:

    * *
          * Pattern p = Pattern.compile("cat");
    @@ -1134,17 +1135,17 @@
          * string may contain references to captured subsequences as in the {@link
          * #appendReplacement appendReplacement} method.
          *
    -     * 

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * the replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and * backslashes are used to escape literal characters in the replacement * string. * - *

    Given the regular expression a*b, the input - * "aabfooaabfooabfoob", and the replacement string - * "-", an invocation of this method on a matcher for that - * expression would yield the string "-foo-foo-foo-". + *

    Given the regular expression {@code a*b}, the input + * {@code "aabfooaabfooabfoob"}, and the replacement string + * {@code "-"}, an invocation of this method on a matcher for that + * expression would yield the string {@code "-foo-foo-foo-"}. * *

    Invoking this method changes this matcher's state. If the matcher * is to be used in further matching operations then it should first be @@ -1186,18 +1187,18 @@ * references to captured subsequences as in the {@link #appendReplacement * appendReplacement} method. * - *

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * a replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and * backslashes are used to escape literal characters in the replacement * string. * - *

    Given the regular expression dog, the input - * "zzzdogzzzdogzzz", and the function + *

    Given the regular expression {@code dog}, the input + * {@code "zzzdogzzzdogzzz"}, and the function * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on * a matcher for that expression would yield the string - * "zzzDOGzzzDOGzzz". + * {@code "zzzDOGzzzDOGzzz"}. * *

    Invoking this method changes this matcher's state. If the matcher * is to be used in further matching operations then it should first be @@ -1360,17 +1361,17 @@ * string may contain references to captured subsequences as in the {@link * #appendReplacement appendReplacement} method. * - *

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * the replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and * backslashes are used to escape literal characters in the replacement * string. * - *

    Given the regular expression dog, the input - * "zzzdogzzzdogzzz", and the replacement string - * "cat", an invocation of this method on a matcher for that - * expression would yield the string "zzzcatzzzdogzzz".

    + *

    Given the regular expression {@code dog}, the input + * {@code "zzzdogzzzdogzzz"}, and the replacement string + * {@code "cat"}, an invocation of this method on a matcher for that + * expression would yield the string {@code "zzzcatzzzdogzzz"}.

    * *

    Invoking this method changes this matcher's state. If the matcher * is to be used in further matching operations then it should first be @@ -1408,18 +1409,18 @@ * references to captured subsequences as in the {@link #appendReplacement * appendReplacement} method. * - *

    Note that backslashes (\) and dollar signs ($) in + *

    Note that backslashes ({@code \}) and dollar signs ({@code $}) in * the replacement string may cause the results to be different than if it * were being treated as a literal replacement string. Dollar signs may be * treated as references to captured subsequences as described above, and * backslashes are used to escape literal characters in the replacement * string. * - *

    Given the regular expression dog, the input - * "zzzdogzzzdogzzz", and the function + *

    Given the regular expression {@code dog}, the input + * {@code "zzzdogzzzdogzzz"}, and the function * {@code mr -> mr.group().toUpperCase()}, an invocation of this method on * a matcher for that expression would yield the string - * "zzzDOGzzzdogzzz". + * {@code "zzzDOGzzzdogzzz"}. * *

    Invoking this method changes this matcher's state. If the matcher * is to be used in further matching operations then it should first be @@ -1471,8 +1472,8 @@ * Sets the limits of this matcher's region. The region is the part of the * input sequence that will be searched to find a match. Invoking this * method resets the matcher, and then sets the region to start at the - * index specified by the start parameter and end at the - * index specified by the end parameter. + * index specified by the {@code start} parameter and end at the + * index specified by the {@code end} parameter. * *

    Depending on the transparency and anchoring being used (see * {@link #useTransparentBounds useTransparentBounds} and @@ -1534,8 +1535,8 @@ /** * Queries the transparency of region bounds for this matcher. * - *

    This method returns true if this matcher uses - * transparent bounds, false if it uses opaque + *

    This method returns {@code true} if this matcher uses + * transparent bounds, {@code false} if it uses opaque * bounds. * *

    See {@link #useTransparentBounds useTransparentBounds} for a @@ -1543,8 +1544,8 @@ * *

    By default, a matcher uses opaque region boundaries. * - * @return true iff this matcher is using transparent bounds, - * false otherwise. + * @return {@code true} iff this matcher is using transparent bounds, + * {@code false} otherwise. * @see java.util.regex.Matcher#useTransparentBounds(boolean) * @since 1.5 */ @@ -1555,9 +1556,9 @@ /** * Sets the transparency of region bounds for this matcher. * - *

    Invoking this method with an argument of true will set this + *

    Invoking this method with an argument of {@code true} will set this * matcher to use transparent bounds. If the boolean - * argument is false, then opaque bounds will be used. + * argument is {@code false}, then opaque bounds will be used. * *

    Using transparent bounds, the boundaries of this * matcher's region are transparent to lookahead, lookbehind, @@ -1586,16 +1587,16 @@ /** * Queries the anchoring of region bounds for this matcher. * - *

    This method returns true if this matcher uses - * anchoring bounds, false otherwise. + *

    This method returns {@code true} if this matcher uses + * anchoring bounds, {@code false} otherwise. * *

    See {@link #useAnchoringBounds useAnchoringBounds} for a * description of anchoring bounds. * *

    By default, a matcher uses anchoring region boundaries. * - * @return true iff this matcher is using anchoring bounds, - * false otherwise. + * @return {@code true} iff this matcher is using anchoring bounds, + * {@code false} otherwise. * @see java.util.regex.Matcher#useAnchoringBounds(boolean) * @since 1.5 */ @@ -1606,9 +1607,9 @@ /** * Sets the anchoring of region bounds for this matcher. * - *

    Invoking this method with an argument of true will set this + *

    Invoking this method with an argument of {@code true} will set this * matcher to use anchoring bounds. If the boolean - * argument is false, then non-anchoring bounds will be + * argument is {@code false}, then non-anchoring bounds will be * used. * *

    Using anchoring bounds, the boundaries of this @@ -1631,7 +1632,7 @@ /** *

    Returns the string representation of this matcher. The - * string representation of a Matcher contains information + * string representation of a {@code Matcher} contains information * that may be useful for debugging. The exact format is unspecified. * * @return The string representation of this matcher