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:
parent
7f5c93ac95
commit
0384c7652f
|
@ -1,3 +1,16 @@
|
|||
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.
|
||||
|
||||
2005-02-07 Robert Schuster <thebohemian@gmx.net>
|
||||
|
||||
* gnu/java/nio/charset/ISO_8859_1.java,
|
||||
|
|
|
@ -212,7 +212,10 @@ public final class Matcher
|
|||
if (match != null)
|
||||
{
|
||||
if (match.getStartIndex() == 0)
|
||||
return true;
|
||||
{
|
||||
position = match.getEndIndex();
|
||||
return true;
|
||||
}
|
||||
match = null;
|
||||
}
|
||||
return false;
|
||||
|
@ -230,7 +233,13 @@ public final class Matcher
|
|||
*/
|
||||
public boolean matches ()
|
||||
{
|
||||
return find(0);
|
||||
if (lookingAt())
|
||||
{
|
||||
if (position == input.length())
|
||||
return true;
|
||||
match = null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue