From: Timo Lindfors <address@hidden>
To: Amit <address@hidden>, Timo Lindfors <address@hidden>,
address@hidden
Subject: [bugs #11728] String.split() function return worng results for a
String with TAB delimiters "t"
Date: Tue, 1 Feb 2005 21:43:20 +0000
Follow-up Comment #1, bugs #11728 (project classpath):
I'm not sure but it seems to me that this is caused by
the construct
while (...) {
...
while(empties-- > 0)
list.add("");
...
}
in java.util.regex.Pattern.split(input, limit). Idea is probably to call
list.add empties times. However, if empties is already zero the construct
will decrease it to -1. This will cause incorrect behavior on next
iteration
of the while loop and skip one empty token.
The attached patch works for me and your testcase.
_______________________________________________________
Additional Item Attachment:
File name: regex-pattern.diff Size:0 KB
proposed patch
<http://savannah.gnu.org/bugs/download.php?item_id=11728&item_file_id=2137>
_______________________________________________________
This item URL is:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11728>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/