[Bug libgcj/39481] New: StringTokenizer.hasMoreTokens() can screw up tokens
receive-spam at yandex dot ru
gcc-bugzilla@gcc.gnu.org
Tue Mar 17 12:41:00 GMT 2009
Test program:
*import java.util.StringTokenizer;
public class gcjbug {
public static void main(String[] args) {
StringTokenizer t = new StringTokenizer("#a=1 #b=2");
for (int i = 0; i < 2; i++) {
if (t.hasMoreTokens())
System.out.println(t.nextToken("=") + t.nextToken("#"));
}
}
}
Expected output:
#a=1
#b=2
Actual output:
#a=1
b=2
Reproduced with 2009/03/16 snapshot of gcc 4.4. After commenting out line "if
(t.hasMoreTokens())" output becomes correct.
--
Summary: StringTokenizer.hasMoreTokens() can screw up tokens
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: receive-spam at yandex dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39481
More information about the Java-prs
mailing list