ppkarwasz commented on code in PR #1164:
URL: https://github.com/apache/logging-log4j2/pull/1164#discussion_r1046674709


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java:
##########
@@ -367,7 +357,7 @@ private static ConfigurationSource 
getConfigurationSource(URL url) {
             try {
                 if (file != null) {
                     return new 
ConfigurationSource(urlConnection.getInputStream(), 
FileUtils.fileFromUri(url.toURI()));
-                } else if (JAR.equals(url.getProtocol())) {
+                } else if (urlConnection instanceof JarURLConnection) {

Review Comment:
   The problem with `sun.net.www.protocol.jar.JarURLConnection` was that it 
leaked file descriptors upon each call to `getLastModified()` (cf. 
[LOG4J2-3423](https://issues.apache.org/jira/browse/LOG4J2-3423)).
   
   I am not sure why IntelliJ decided not to extend the abstract class 
`java.net.JarURLConnection`, but I guess we don't need any workaround with 
classes that do not extend `java.net.JarURLConnection`.
   
   BTW: this problem was already reported as 
[LOG4J2-3047](https://issues.apache.org/jira/browse/LOG4J2-3047).



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