axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding DeserializationContext.java
Date Tue, 02 Oct 2001 23:06:36 GMT
rubys       01/10/02 16:06:36

  Modified:    java/src/org/apache/axis/encoding
                        DeserializationContext.java
  Log:
  Heed the advice of Berin Loritsch - apparently older versions of Xerces
  parsers did not always clean up after themselves after an error.  Whether
  this was addressed completely apparently is not known.  However, such
  problems would be difficult to debug; and the negative performance impact
  of throwing away the parser on error would only affect error cases.
  
  Revision  Changes    Path
  1.24      +8 -7      xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java
  
  Index: DeserializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DeserializationContext.java	2001/10/02 19:11:12	1.23
  +++ DeserializationContext.java	2001/10/02 23:06:36	1.24
  @@ -157,15 +157,16 @@
           if (inputSource != null) {
               SAXParser parser = XMLUtils.getSAXParser();
               try {
  -                try {
  -                    parser.parse(inputSource, this);
  -                } catch (IOException e) {
  -                    throw new SAXException(e);
  -                }
  -                inputSource = null;
  -            } finally {
  +                parser.parse(inputSource, this);
  +
  +                // only release the parser for reuse if there wasn't an
  +                // error.  While parsers should be reusable, don't trust
  +                // parsers that died to clean up appropriately.
                   XMLUtils.releaseSAXParser(parser);
  +            } catch (IOException e) {
  +                throw new SAXException(e);
               }
  +            inputSource = null;
           }
       }
       
  
  
  

Mime
View raw message