[ http://issues.apache.org/jira/browse/XERCESJ-946?page=all ]
     
Ankit Pasricha resolved XERCESJ-946:
------------------------------------

    Resolution: Fixed

> org.w3c.dom.ls.LSParser.abort() throws unexpected RuntimeException
> ------------------------------------------------------------------
>
>          Key: XERCESJ-946
>          URL: http://issues.apache.org/jira/browse/XERCESJ-946
>      Project: Xerces2-J
>         Type: Bug
>   Components: DOM
>     Versions: 2.6.2
>     Reporter: Venugopal Rao K
>     Assignee: Ankit Pasricha

>
> import java.io.*;
> import org.w3c.dom.ls.*;
> import org.w3c.dom.*;
> import javax.xml.parsers.*;
> public class Test {
>     public static void main(String[] argv) {
>         Document doc = null;
>         try {
>             DocumentBuilder builder = 
> DocumentBuilderFactory.newInstance().newDo
> cumentBuilder();
>             doc = builder.parse(new StringBufferInputStream("<ROOT></ROOT>
> "));
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>         DOMImplementationLS implLS = (DOMImplementationLS) 
> doc.getImplementation().getFeature("LS","3.0");
>         final LSParser parser = 
> implLS.createLSParser(DOMImplementationLS.MODE_S
> YNCHRONOUS,null);
>         final LSInput input = implLS.createLSInput();
>         try {
>             input.setByteStream(new PipedInputStream(new 
> PipedOutputStream()));
>         } catch(IOException e) {
>             e.printStackTrace();
>         }
>         Thread t = new Thread(new Runnable() {
>             public void run() {
>                 Document d = parser.parse(input);
>             }
>         });
>         try {
>             t.start();
>             t.join(1000);
>         } catch(InterruptedException ie) {
>             ie.printStackTrace();
>         }
>         try {
>             parser.abort();
>         } catch (Throwable e) {
>             System.out.println("Unexpected exception: "+e);
>             e.printStackTrace();
>             System.exit(-1);
>         }
>     }
> }
> DOMLS says exceptions should not be thrown.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to