ppkarwasz commented on a change in pull request #784:
URL: https://github.com/apache/logging-log4j2/pull/784#discussion_r819781930



##########
File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
##########
@@ -339,17 +339,9 @@ public static ConfigurationSource fromUri(final URI 
configLocation) {
             return null;
         }
         try {
-            URL url = configLocation.toURL();
-            URLConnection urlConnection = 
UrlConnectionFactory.createConnection(url);
-            InputStream is = urlConnection.getInputStream();
-            long lastModified = urlConnection.getLastModified();
-            return new ConfigurationSource(is, configLocation.toURL(), 
lastModified);
-        } catch (final FileNotFoundException ex) {
-            ConfigurationFactory.LOGGER.warn("Could not locate file {}", 
configLocation.toString());
+            return getConfigurationSource(configLocation.toURL());

Review comment:
       The replacement protects against dangling file descriptors that appear 
when `getLastModified()` is called.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to