< prev index next >
jdk/src/java.base/share/classes/java/util/regex/Matcher.java
Print this page
*** 972,982 ****
* If the replacement string refers to a named-capturing
* group that does not exist in the pattern
* @throws IndexOutOfBoundsException
* If the replacement string refers to a capturing group
* that does not exist in the pattern
! * @since 1.9
*/
public Matcher appendReplacement(StringBuilder sb, String replacement) {
// If no match, return error
if (first < 0)
throw new IllegalStateException("No match available");
--- 972,982 ----
* If the replacement string refers to a named-capturing
* group that does not exist in the pattern
* @throws IndexOutOfBoundsException
* If the replacement string refers to a capturing group
* that does not exist in the pattern
! * @since 9
*/
public Matcher appendReplacement(StringBuilder sb, String replacement) {
// If no match, return error
if (first < 0)
throw new IllegalStateException("No match available");
*** 1115,1125 ****
* @param sb
* The target string builder
*
* @return The target string builder
*
! * @since 1.9
*/
public StringBuilder appendTail(StringBuilder sb) {
sb.append(text, lastAppendPosition, getTextLength());
return sb;
}
--- 1115,1125 ----
* @param sb
* The target string builder
*
* @return The target string builder
*
! * @since 9
*/
public StringBuilder appendTail(StringBuilder sb) {
sb.append(text, lastAppendPosition, getTextLength());
return sb;
}
*** 1227,1237 ****
* needed.
* @throws NullPointerException if the replacer function is null
* @throws ConcurrentModificationException if it is detected, on a
* best-effort basis, that the replacer function modified this
* matcher's state
! * @since 1.9
*/
public String replaceAll(Function<MatchResult, String> replacer) {
Objects.requireNonNull(replacer);
reset();
boolean result = find();
--- 1227,1237 ----
* needed.
* @throws NullPointerException if the replacer function is null
* @throws ConcurrentModificationException if it is detected, on a
* best-effort basis, that the replacer function modified this
* matcher's state
! * @since 9
*/
public String replaceAll(Function<MatchResult, String> replacer) {
Objects.requireNonNull(replacer);
reset();
boolean result = find();
*** 1271,1281 ****
* {@code Spliterator} is <em>fail-fast</em> and will, on a best-effort
* basis, throw a {@link java.util.ConcurrentModificationException} if such
* modification is detected.
*
* @return a sequential stream of match results.
! * @since 1.9
*/
public Stream<MatchResult> results() {
class MatchResultIterator implements Iterator<MatchResult> {
// -ve for call to find, 0 for not found, 1 for found
int state = -1;
--- 1271,1281 ----
* {@code Spliterator} is <em>fail-fast</em> and will, on a best-effort
* basis, throw a {@link java.util.ConcurrentModificationException} if such
* modification is detected.
*
* @return a sequential stream of match results.
! * @since 9
*/
public Stream<MatchResult> results() {
class MatchResultIterator implements Iterator<MatchResult> {
// -ve for call to find, 0 for not found, 1 for found
int state = -1;
*** 1449,1459 ****
* needed.
* @throws NullPointerException if the replacer function is null
* @throws ConcurrentModificationException if it is detected, on a
* best-effort basis, that the replacer function modified this
* matcher's state
! * @since 1.9
*/
public String replaceFirst(Function<MatchResult, String> replacer) {
Objects.requireNonNull(replacer);
reset();
if (!find())
--- 1449,1459 ----
* needed.
* @throws NullPointerException if the replacer function is null
* @throws ConcurrentModificationException if it is detected, on a
* best-effort basis, that the replacer function modified this
* matcher's state
! * @since 9
*/
public String replaceFirst(Function<MatchResult, String> replacer) {
Objects.requireNonNull(replacer);
reset();
if (!find())
< prev index next >