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
This commit is contained in:
@@ -387,10 +387,9 @@ public final class UtilXml {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user