This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-logging.git

commit 2f8d577970fffcffebada11e1baf4680d811987a
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Nov 19 11:45:20 2023 -0500

    Fix compiler warning
---
 src/main/java/org/apache/commons/logging/LogFactory.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java 
b/src/main/java/org/apache/commons/logging/LogFactory.java
index 8c76be3..938ac63 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -1052,9 +1052,8 @@ public abstract class LogFactory {
      * hasMoreElements method returns false (ie an "empty" enumeration).
      * If resources could not be listed for some reason, null is returned.
      */
-    private static Enumeration getResources(final ClassLoader loader, final 
String name) {
-        final PrivilegedAction action =
-            () -> {
+    private static Enumeration<URL> getResources(final ClassLoader loader, 
final String name) {
+        return 
AccessController.doPrivileged((PrivilegedAction<Enumeration<URL>>) () -> {
             try {
                 if (loader != null) {
                     return loader.getResources(name);
@@ -1062,8 +1061,7 @@ public abstract class LogFactory {
                 return ClassLoader.getSystemResources(name);
             } catch (final IOException e) {
                 if (isDiagnosticsEnabled()) {
-                    logDiagnostic("Exception while trying to find 
configuration file " +
-                                  name + ":" + e.getMessage());
+                    logDiagnostic("Exception while trying to find 
configuration file " + name + ":" + e.getMessage());
                 }
                 return null;
             } catch (final NoSuchMethodError e) {
@@ -1072,9 +1070,7 @@ public abstract class LogFactory {
                 // this case.
                 return null;
             }
-        };
-        final Object result = AccessController.doPrivileged(action);
-        return (Enumeration) result;
+        });
     }
 
     /**

Reply via email to