Fix compiler warning
This commit is contained in:
@@ -1052,9 +1052,8 @@ public abstract class LogFactory {
|
|||||||
* hasMoreElements method returns false (ie an "empty" enumeration).
|
* hasMoreElements method returns false (ie an "empty" enumeration).
|
||||||
* If resources could not be listed for some reason, null is returned.
|
* If resources could not be listed for some reason, null is returned.
|
||||||
*/
|
*/
|
||||||
private static Enumeration getResources(final ClassLoader loader, final String name) {
|
private static Enumeration<URL> getResources(final ClassLoader loader, final String name) {
|
||||||
final PrivilegedAction action =
|
return AccessController.doPrivileged((PrivilegedAction<Enumeration<URL>>) () -> {
|
||||||
() -> {
|
|
||||||
try {
|
try {
|
||||||
if (loader != null) {
|
if (loader != null) {
|
||||||
return loader.getResources(name);
|
return loader.getResources(name);
|
||||||
@@ -1062,8 +1061,7 @@ public abstract class LogFactory {
|
|||||||
return ClassLoader.getSystemResources(name);
|
return ClassLoader.getSystemResources(name);
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
if (isDiagnosticsEnabled()) {
|
if (isDiagnosticsEnabled()) {
|
||||||
logDiagnostic("Exception while trying to find configuration file " +
|
logDiagnostic("Exception while trying to find configuration file " + name + ":" + e.getMessage());
|
||||||
name + ":" + e.getMessage());
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} catch (final NoSuchMethodError e) {
|
} catch (final NoSuchMethodError e) {
|
||||||
@@ -1072,9 +1070,7 @@ public abstract class LogFactory {
|
|||||||
// this case.
|
// this case.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
final Object result = AccessController.doPrivileged(action);
|
|
||||||
return (Enumeration) result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user