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 "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2006/09/29 07:02:55 UTC

[jira] Assigned: (XERCESJ-1182) Race condition results in invalid event type being reported from XMLStreamReader

     [ http://issues.apache.org/jira/browse/XERCESJ-1182?page=all ]

Michael Glavassevich reassigned XERCESJ-1182:
---------------------------------------------

    Assignee: Michael Glavassevich

> Race condition results in invalid event type being reported from XMLStreamReader
> --------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1182
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1182
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: test.xml
>
>
> The following code prints out "7" as it should do - the first event is a START_DOCUMENT event.
>       SAXParserFactory factory = SAXParserFactory.newInstance();
>       factory.setNamespaceAware(true);
>       factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
>       SAXParser parser = factory.newSAXParser();       
>       SAXSource source = new SAXSource(parser.getXMLReader(), new InputSource(FunctionalTestEventReading.class.getResourceAsStream("test.xml")));       
>        XMLInputFactory inFac = new XMLInputFactoryImpl();
>        XMLStreamReader reader = inFac.createXMLStreamReader(source);
>        Thread.sleep(1000);
>        System.err.println(reader.getEventType());
> If I remove the Thread.sleep, however, it prints "0". It would seem like something is being kicked off in another thread, and not having time to get the first bit of the document parsed before the call to getEventType(). FWIW I'm running this under Eclipse in a simple test class with a main method - presumably this is somewhat dependent on machine speed/environment etc. to be able to reproduce. I have attached the xml file I'm testing with.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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