logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1617639 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
Date Wed, 13 Aug 2014 00:33:50 GMT
Author: mattsicker
Date: Wed Aug 13 00:33:50 2014
New Revision: 1617639

URL: http://svn.apache.org/r1617639
Log:
Use Loader class instead of Class.forName().

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java?rev=1617639&r1=1617638&r2=1617639&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
Wed Aug 13 00:33:50 2014
@@ -74,8 +74,8 @@ public class Interpolator implements Str
         lookups.put("env", new EnvironmentLookup());
         try {
             // [LOG4J2-703] We might be on Android
-            lookups.put("jndi", (StrLookup) Class.forName("org.apache.logging.log4j.core.lookup.JndiLookup")
-                    .newInstance());
+            lookups.put("jndi",
+                Loader.newCheckedInstanceOf("org.apache.logging.log4j.core.lookup.JndiLookup",
StrLookup.class));
         } catch (Throwable e) {
             // java.lang.VerifyError: org/apache/logging/log4j/core/lookup/JndiLookup
             LOGGER.warn(



Mime
View raw message