You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2003/10/14 16:34:26 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dtd XMLDTDLoader.java

mrglavas    2003/10/14 07:34:26

  Modified:    java/src/org/apache/xerces/impl/dtd XMLDTDLoader.java
  Log:
  After loading a DTD grammar the streams opened 
  by the parser need to be closed.
  
  Repeated use of DTD Loader would eventually lead to a 
  java.io.FileNotFoundException (Too many open files), because 
  none of the streams were being closed.
  
  Revision  Changes    Path
  1.9       +6 -2      xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDLoader.java
  
  Index: XMLDTDLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDLoader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLDTDLoader.java	14 Sep 2003 04:31:04 -0000	1.8
  +++ XMLDTDLoader.java	14 Oct 2003 14:34:26 -0000	1.9
  @@ -400,11 +400,15 @@
           // know which grammar it is, and we don't know the root name anyway...
   
           // actually start the parsing!
  -        fDTDScanner.setInputSource(source);
           try {
  +            fDTDScanner.setInputSource(source);
               fDTDScanner.scanDTDExternalSubset(true);
           } catch (EOFException e) {
               // expected behaviour...
  +        }
  +        finally {
  +            // Close all streams opened by the parser.
  +            fEntityManager.closeReaders();
           }
           if(fDTDGrammar != null && fGrammarPool != null) {
               fGrammarPool.cacheGrammars(XMLDTDDescription.XML_DTD, new Grammar[] {fDTDGrammar});
  
  
  

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