You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/11 15:28:15 UTC

(commons-logging) 01/02: Fix generics compiler warning

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 8b3454ac610c9e0482d965382107c56606e963dd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat May 11 11:21:55 2024 -0400

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

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java b/src/main/java/org/apache/commons/logging/LogFactory.java
index c169906..a751fdf 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -1424,12 +1424,11 @@ public abstract class LogFactory {
     protected static LogFactory newFactory(final String factoryClass,
                                            final ClassLoader classLoader,
                                            final ClassLoader contextClassLoader)
-        throws LogConfigurationException {
+            throws LogConfigurationException {
         // Note that any unchecked exceptions thrown by the createFactory
         // method will propagate out of this method; in particular a
         // ClassCastException can be thrown.
-        final Object result = AccessController.doPrivileged(
-            (PrivilegedAction) () -> createFactory(factoryClass, classLoader));
+        final Object result = AccessController.doPrivileged((PrivilegedAction<?>) () -> createFactory(factoryClass, classLoader));
 
         if (result instanceof LogConfigurationException) {
             final LogConfigurationException ex = (LogConfigurationException) result;
@@ -1439,8 +1438,7 @@ public abstract class LogFactory {
             throw ex;
         }
         if (isDiagnosticsEnabled()) {
-            logDiagnostic("Created object " + objectId(result) + " to manage class loader " +
-                          objectId(contextClassLoader));
+            logDiagnostic("Created object " + objectId(result) + " to manage class loader " + objectId(contextClassLoader));
         }
         return (LogFactory) result;
     }