mbeckerle commented on a change in pull request #219: Ensure InputStreams
created by includes/imports are closed
URL: https://github.com/apache/incubator-daffodil/pull/219#discussion_r284822950
##########
File path:
daffodil-lib/src/main/scala/org/apache/daffodil/xml/DaffodilXMLLoader.scala
##########
@@ -463,9 +462,11 @@ trait SchemaAwareLoaderMixin {
* it a plain old file or resource, and not try to play games to get it to
* pick up the file/line/col information from attributes of the elements.
*/
- def validateSchema(source: DaffodilSchemaSource) = {
- val saxSource = new SAXSource(source.newInputSource())
+ def validateSchema(source: DaffodilSchemaSource): Unit = {
+ val inputSource = source.newInputSource()
+ val saxSource = new SAXSource(inputSource)
sf.newSchema(saxSource)
+ inputSource.getByteStream().close()
Review comment:
At the end of validation here can we assert that the stream is closed by
xerces?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services