You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/08/26 15:25:00 UTC

DO NOT REPLY [Bug 12040] New: - No return from parse when parsing a partial comment content

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12040>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12040

No return from parse when parsing a partial comment content

           Summary: No return from parse when parsing a partial comment
                    content
           Product: Xerces2-J
           Version: 2.0.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: george@sync.ro


Trying to parse a comment that ends with "-" followed by the end of file cause 
the parser to freeze. It never returns from the parse method. See below a 
sample code to reproduce this.


import java.io.StringReader;
import org.xml.sax.InputSource;
import org.apache.xerces.parsers.SAXParser;

public class BugXerces {

  public static void main(String[] args) {
      SAXParser parser = new SAXParser();
      String pref = "<!-- \n test -";
      try {
        InputSource inputSource = new InputSource(new StringReader(pref));
        System.out.println("Parsing: " + pref);
        parser.parse(inputSource);

      } catch (Exception ex) {
        ex.printStackTrace();
      }
      // Does not reach this line !!!!!
      System.out.println("Parsing ended..");
  }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org