1
0

Fix generics compiler warning

This commit is contained in:
Gary Gregory
2024-05-11 11:21:55 -04:00
parent e37750947d
commit 8b3454ac61

View File

@@ -1428,8 +1428,7 @@ public abstract class LogFactory {
// Note that any unchecked exceptions thrown by the createFactory // Note that any unchecked exceptions thrown by the createFactory
// method will propagate out of this method; in particular a // method will propagate out of this method; in particular a
// ClassCastException can be thrown. // ClassCastException can be thrown.
final Object result = AccessController.doPrivileged( final Object result = AccessController.doPrivileged((PrivilegedAction<?>) () -> createFactory(factoryClass, classLoader));
(PrivilegedAction) () -> createFactory(factoryClass, classLoader));
if (result instanceof LogConfigurationException) { if (result instanceof LogConfigurationException) {
final LogConfigurationException ex = (LogConfigurationException) result; final LogConfigurationException ex = (LogConfigurationException) result;
@@ -1439,8 +1438,7 @@ public abstract class LogFactory {
throw ex; throw ex;
} }
if (isDiagnosticsEnabled()) { if (isDiagnosticsEnabled()) {
logDiagnostic("Created object " + objectId(result) + " to manage class loader " + logDiagnostic("Created object " + objectId(result) + " to manage class loader " + objectId(contextClassLoader));
objectId(contextClassLoader));
} }
return (LogFactory) result; return (LogFactory) result;
} }