Reported by Timo Lindfors <timo.lindfors@iki.fi> java/util/regex/Matcher.java...
2005-02-07 Mark Wielaard <mark@klomp.org> Reported by Timo Lindfors <timo.lindfors@iki.fi> java/util/regex/Matcher.java (lookingAt): Set position when match found. (matches): Implemented through lookingAt(). 2005-02-07 Mark Wielaard <mark@klomp.org> Fix suggested by Timo Lindfors <timo.lindfors@iki.fi> * java/util/regex/Pattern.java (split(CharSequence,int)): Fix while empties > 0 loops. From-SVN: r94713
This commit is contained in:
committed by
Anthony Green
parent
7f5c93ac95
commit
0384c7652f
@@ -198,8 +198,11 @@ public final class Pattern implements Serializable
|
||||
empties++;
|
||||
else
|
||||
{
|
||||
while (empties-- > 0)
|
||||
list.add("");
|
||||
while (empties > 0)
|
||||
{
|
||||
list.add("");
|
||||
empties--;
|
||||
}
|
||||
|
||||
String text = input.subSequence(start, end).toString();
|
||||
list.add(text);
|
||||
@@ -222,8 +225,11 @@ public final class Pattern implements Serializable
|
||||
int max = limit - list.size();
|
||||
empties = (empties > max) ? max : empties;
|
||||
}
|
||||
while (empties-- > 0)
|
||||
list.add("");
|
||||
while (empties > 0)
|
||||
{
|
||||
list.add("");
|
||||
empties--;
|
||||
}
|
||||
}
|
||||
|
||||
// last token at end
|
||||
|
||||
Reference in New Issue
Block a user