You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2001/11/26 10:36:00 UTC

DO NOT REPLY [Bug 5079] New: - Closing InputStreams/Readers

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5079>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5079

Closing InputStreams/Readers

           Summary: Closing InputStreams/Readers
           Product: Xerces2-J
           Version: 2.0.0 [beta 2]
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XNI
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: jjc@jclark.com


With org.apache.xerces.xni.parser.XMLPullParserConfiguration, an
application may choose not to parse a document completely.  At the
point where it stops passing multiple external entities may be open.
There doesn't seem to be any way for the application to make the
parser release the resources consumed by those open entities (e.g. by
closing the Reader or InputStream).  I would suggest that
XMLPullParserConfiguration needs a close() method to do this.

Whilst looking at this problem, I noticed that Xerces does not
currently appear to close all the InputStreams/Readers that it opens.
AbstractSAXParser.parse(String) has some code to close the
InputStream/Reader, but this looks very fishy: XMLReader.parse(String
s) should be equivalent to parse(new InputSource(systemId)), but it's
not in respect of closing.  Surely this should be dealt with an the
XNI level not the SAX level.

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