bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug xml/32539] New: gnu.xml.stream.XMLParser: hasNext() assumes next()


From: kwolf at suse dot de
Subject: [Bug xml/32539] New: gnu.xml.stream.XMLParser: hasNext() assumes next() to follow immediately
Date: 28 Jun 2007 18:47:15 -0000

The implementation of gnu.xml.stream.XMLParser.hasNext() seems to assume that
it is immediately followed by next(). This may lead to wrong results of some
other functions called after hasNext() but before next().

I expected the following code to produce the same output twice, each line
starting with "x = x" (event and reader.getEventType() should be the same), as
it does in Sun's implementation. In Classpath implementation the second line
prints "x = y" where x in general is different from y (and y is the type of the
following event).

int event = reader.getEventType();
System.out.println(event + "=" + reader.getEventType() + "; hasNext = " +
reader.hasNext());
System.out.println(event + "=" + reader.getEventType() + "; hasNext = " +
reader.hasNext());


-- 
           Summary: gnu.xml.stream.XMLParser: hasNext() assumes next() to
                    follow immediately
           Product: classpath
           Version: 0.93
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: xml
        AssignedTo: dog at gnu dot org
        ReportedBy: kwolf at suse dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32539





reply via email to

[Prev in Thread] Current Thread [Next in Thread]