Simple rearrangement of code only; no functionality change (though the diffs don't show that clearly).
Turned a complicated anonymous class declaration into a simple anonymous class that calls a method on LogFactory containing all the code previously within the anonymous class declaration. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@170355 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -632,6 +632,26 @@ public abstract class LogFactory {
|
|||||||
Object result = AccessController.doPrivileged(
|
Object result = AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
public Object run() {
|
public Object run() {
|
||||||
|
return createFactory(factoryClass, classLoader);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result instanceof LogConfigurationException)
|
||||||
|
throw (LogConfigurationException)result;
|
||||||
|
|
||||||
|
return (LogFactory)result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements the operations described in the javadoc for newFactory.
|
||||||
|
*
|
||||||
|
* @param factoryClass
|
||||||
|
* @param classLoader
|
||||||
|
*
|
||||||
|
* @returns either a LogFactory object or a LogConfigurationException object.
|
||||||
|
*/
|
||||||
|
protected static Object createFactory(String factoryClass, ClassLoader classLoader) {
|
||||||
|
|
||||||
// This will be used to diagnose bad configurations
|
// This will be used to diagnose bad configurations
|
||||||
// and allow a useful message to be sent to the user
|
// and allow a useful message to be sent to the user
|
||||||
Class logFactoryClass = null;
|
Class logFactoryClass = null;
|
||||||
@@ -694,13 +714,6 @@ public abstract class LogFactory {
|
|||||||
return new LogConfigurationException(e);
|
return new LogConfigurationException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (result instanceof LogConfigurationException)
|
|
||||||
throw (LogConfigurationException)result;
|
|
||||||
|
|
||||||
return (LogFactory)result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static InputStream getResourceAsStream(final ClassLoader loader,
|
private static InputStream getResourceAsStream(final ClassLoader loader,
|
||||||
final String name)
|
final String name)
|
||||||
|
|||||||
Reference in New Issue
Block a user