You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by je...@locus.apache.org on 2000/06/01 03:14:34 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/utils ChunkyByteArray.java

jeffreyr    00/05/31 18:14:32

  Modified:    java/src/org/apache/xerces/utils ChunkyByteArray.java
  Log:
  null the fInputStream so we don't ever attempt to close handle twice
  
  Revision  Changes    Path
  1.5       +7 -7      xml-xerces/java/src/org/apache/xerces/utils/ChunkyByteArray.java
  
  Index: ChunkyByteArray.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/ChunkyByteArray.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ChunkyByteArray.java	2000/05/25 00:49:04	1.4
  +++ ChunkyByteArray.java	2000/06/01 01:14:32	1.5
  @@ -167,11 +167,9 @@
           int index = offset & CHUNK_MASK;
           try {
               return fData[chunk][index];
  -        }
  -        catch (NullPointerException ex) {
  +        } catch (NullPointerException ex) {
               // ignore -- let fill create new chunk
  -        }
  -        catch (ArrayIndexOutOfBoundsException e) {
  +        } catch (ArrayIndexOutOfBoundsException e) {
               // current chunk array is not big enough; resize
               byte newdata[][] = new byte[fData.length * 2][];
               System.arraycopy(fData, 0, newdata, 0, fData.length);
  @@ -192,7 +190,7 @@
        *         <code>false</code> otherwise.
        */
       public boolean atEOF(int offset) {
  -        return (offset > fLength);
  +        return(offset > fLength);
       }
   
   
  @@ -203,9 +201,11 @@
        * @exception IOException
        */
       public void close() throws IOException {
  -        if( fInputStream != null )
  -           fInputStream.close(); 
  +        if ( fInputStream != null ) {
  +             fInputStream.close(); 
  +             fInputStream = null; // Null it 
           }
  +    }
   
   
       //