Use Map API
This commit is contained in:
@@ -254,7 +254,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* The {@link org.apache.commons.logging.Log} instances that have
|
* The {@link org.apache.commons.logging.Log} instances that have
|
||||||
* already been created, keyed by logger name.
|
* already been created, keyed by logger name.
|
||||||
*/
|
*/
|
||||||
protected Hashtable instances = new Hashtable();
|
protected Hashtable<String, Log> instances = new Hashtable<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the class implementing the Log interface.
|
* Name of the class implementing the Log interface.
|
||||||
@@ -846,12 +846,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Log getInstance(final String name) throws LogConfigurationException {
|
public Log getInstance(final String name) throws LogConfigurationException {
|
||||||
Log instance = (Log) instances.get(name);
|
return instances.computeIfAbsent(name, this::newInstance);
|
||||||
if (instance == null) {
|
|
||||||
instance = newInstance(name);
|
|
||||||
instances.put(name, instance);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user