logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1587414 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Date Tue, 15 Apr 2014 04:57:58 GMT
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());
                 }



Mime
View raw message