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_r284833226
 
 

 ##########
 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:
   Agreed. I thought it might be a simple assert here, but clearly beyond that, 
and unwise change.

----------------------------------------------------------------
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

Reply via email to