You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/04/15 06:57:58 UTC
svn commit: r1587414 -
/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Author: mattsicker
Date: Tue Apr 15 04:57:58 2014
New Revision: 1587414
URL: http://svn.apache.org/r1587414
Log:
Switch to Loader and add finals.
Modified:
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java?rev=1587414&r1=1587413&r2=1587414&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java Tue Apr 15 04:57:58 2014
@@ -46,6 +46,7 @@ import org.apache.logging.log4j.core.con
import org.apache.logging.log4j.core.config.plugins.PluginType;
import org.apache.logging.log4j.core.filter.AbstractFilterable;
import org.apache.logging.log4j.core.helpers.Constants;
+import org.apache.logging.log4j.core.helpers.Loader;
import org.apache.logging.log4j.core.helpers.NameUtil;
import org.apache.logging.log4j.core.impl.Log4jContextFactory;
import org.apache.logging.log4j.core.layout.PatternLayout;
@@ -139,15 +140,15 @@ public abstract class AbstractConfigurat
@Override
public void start() {
pluginManager.collectPlugins();
- PluginManager levelPlugins = new PluginManager("Level");
+ final PluginManager levelPlugins = new PluginManager("Level");
levelPlugins.collectPlugins();
- Map<String, PluginType<?>> plugins = levelPlugins.getPlugins();
+ final Map<String, PluginType<?>> plugins = levelPlugins.getPlugins();
if (plugins != null) {
- for (PluginType<?> type : plugins.values()) {
+ for (final PluginType<?> type : plugins.values()) {
try {
// Cause the class to be initialized if it isn't already.
- Class.forName(type.getPluginClass().getName(), true, type.getPluginClass().getClassLoader());
- } catch (Exception ex) {
+ Loader.initializeClass(type.getPluginClass().getName(), type.getPluginClass().getClassLoader());
+ } catch (final Exception ex) {
LOGGER.error("Unable to initialize {} due to {}: {}", type.getPluginClass().getName(),
ex.getClass().getSimpleName(), ex.getMessage());
}