You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2003/11/19 01:08:10 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/parsers DOMParserImpl.java

elena       2003/11/18 16:08:10

  Modified:    java/src/org/apache/xerces/parsers DOMParserImpl.java
  Log:
  Fixing a bug related to busy -- was not resetting this field properly. Also abort() means that the parsing is stopped,
  therefore we need to throw an exception.
  
  Revision  Changes    Path
  1.9       +8 -11     xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java
  
  Index: DOMParserImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMParserImpl.java	18 Nov 2003 20:45:11 -0000	1.8
  +++ DOMParserImpl.java	19 Nov 2003 00:08:10 -0000	1.9
  @@ -269,8 +269,7 @@
           fRejectedElement.clear ();
           fFilterReject = false;
           fSchemaType = null;
  -        
  -        
  +     
       } // reset()
       
       //
  @@ -732,9 +731,9 @@
               throw new DOMException ( DOMException.INVALID_STATE_ERR,msg);
           }
           
  -        XMLInputSource source = new XMLInputSource (null, uri, null);
  -        fBusy = true;
  +        XMLInputSource source = new XMLInputSource (null, uri, null);        
           try {
  +			fBusy = true;
               parse (source);
               fBusy = false;
           } catch (Exception e){
  @@ -761,9 +760,7 @@
       public Document parse (LSInput is) {
           
           // need to wrap the LSInput with an XMLInputSource
  -        XMLInputSource xmlInputSource = dom2xmlInputSource (is);
  -        fBusy = true;
  -        
  +        XMLInputSource xmlInputSource = dom2xmlInputSource (is);       
           if ( fBusy ) {
               String msg = DOMMessageFormatter.formatMessage (
               DOMMessageFormatter.DOM_DOMAIN,
  @@ -772,6 +769,7 @@
           }
           
           try {
  +			fBusy = true;
               parse (xmlInputSource);
               fBusy = false;
           } catch (Exception e) {
  @@ -875,9 +873,8 @@
       public void abort () {
           // If parse operation is in progress then reset it
           if ( fBusy ) {
  -            //Revisit :: Just reset in not sufficient.
  -            reset ();
  -            fBusy = false;
  +        	fBusy = false;
  +            throw new RuntimeException("Stopped at user request");
           }
           return; // If not busy then this is noop
       }
  
  
  

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