Skip to content
Permalink
Browse files

Improved: Use try with resources in ‘readXmlDocument’

(OFBIZ-8202)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862320 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jun 29, 2019
1 parent 4d7e598 commit c5ea5d85d337cba707d5815ccc11f58e28918644
Showing with 3 additions and 4 deletions.
  1. +3 −4 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
@@ -387,10 +387,9 @@ public static Document readXmlDocument(URL url, boolean validate)
Debug.logWarning("[UtilXml.readXmlDocument] URL was null, doing nothing", module);
return null;
}
InputStream is = url.openStream();
Document document = readXmlDocument(is, validate, url.toString());
is.close();
return document;
try (InputStream is = url.openStream()) {
return readXmlDocument(is, validate, url.toString());
}
}

public static Document readXmlDocument(URL url, boolean validate, boolean withPosition)

0 comments on commit c5ea5d8

Please sign in to comment.
You can’t perform that action at this time.