logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1610569 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/ log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ log4j-core/src/main/java/org/apache/logging/log4j/core/util/ src/chan...
Date Tue, 15 Jul 2014 03:27:38 GMT
Author: ggregory
Date: Tue Jul 15 03:27:38 2014
New Revision: 1610569

URL: http://svn.apache.org/r1610569
Log:
[LOG4J2-713] Android: java.lang.VerifyError: org/apache/logging/log4j/core/util/Closer

Added:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
  (with props)
Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Closer.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java?rev=1610569&r1=1610568&r2=1610569&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
Tue Jul 15 03:27:38 2014
@@ -22,7 +22,7 @@ import javax.naming.NamingException;
 
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.util.Closer;
+import org.apache.logging.log4j.core.util.JndiCloser;
 
 /**
  * Looks up keys from JNDI resources.
@@ -62,7 +62,7 @@ public class JndiLookup implements StrLo
         } catch (final NamingException e) {
             return null;
         } finally {
-            Closer.closeSilently(ctx);
+            JndiCloser.closeSilently(ctx);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java?rev=1610569&r1=1610568&r2=1610569&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/JndiContextSelector.java
Tue Jul 15 03:27:38 2014
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NameNotFoundException;
@@ -30,8 +31,8 @@ import javax.naming.NamingException;
 
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.impl.ContextAnchor;
-import org.apache.logging.log4j.core.util.Closer;
 import org.apache.logging.log4j.core.util.Constants;
+import org.apache.logging.log4j.core.util.JndiCloser;
 import org.apache.logging.log4j.status.StatusLogger;
 
 /**
@@ -118,7 +119,7 @@ public class JndiContextSelector impleme
         } catch (final NamingException ne) {
             LOGGER.error("Unable to lookup " + Constants.JNDI_CONTEXT_NAME, ne);
         } finally {
-            Closer.closeSilently(ctx);
+            JndiCloser.closeSilently(ctx);
         }
 
         return loggingContextName == null ? CONTEXT : locateContext(loggingContextName, null,
configLocation);

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Closer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Closer.java?rev=1610569&r1=1610568&r2=1610569&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Closer.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Closer.java
Tue Jul 15 03:27:38 2014
@@ -25,9 +25,6 @@ import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import javax.naming.Context;
-import javax.naming.NamingException;
-
 /**
  * Helper class for closing resources.
  */
@@ -164,29 +161,4 @@ public final class Closer {
         }
     }
 
-    /**
-     * Closes the specified {@code Context}, ignoring any exceptions thrown by the close
operation.
-     *
-     * @param context the JNDI Context to close, may be {@code null}
-     */
-    public static void closeSilently(final Context context) {
-        try {
-            close(context);
-        } catch (final NamingException ignored) {
-            // ignored
-        }
-    }
-
-    /**
-     * Closes the specified {@code Context}.
-     *
-     * @param context the JNDI Context to close, may be {@code null}
-     * @throws NamingException if a problem occurred closing the specified JNDI Context
-     */
-    public static void close(final Context context) throws NamingException {
-        if (context != null) {
-            context.close();
-        }
-    }
-
 }

Added: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java?rev=1610569&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
(added)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
Tue Jul 15 03:27:38 2014
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.util;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+/**
+ * Helper class for closing JNDI resources.
+ * 
+ * This class is separate from {@link Closer} because JNDI is not in Android.
+ */
+public class JndiCloser {
+
+    /**
+     * Closes the specified {@code Context}.
+     *
+     * @param context the JNDI Context to close, may be {@code null}
+     * @throws NamingException if a problem occurred closing the specified JNDI Context
+     */
+    public static void close(final Context context) throws NamingException {
+        if (context != null) {
+            context.close();
+        }
+    }
+
+    /**
+     * Closes the specified {@code Context}, ignoring any exceptions thrown by the close
operation.
+     *
+     * @param context the JNDI Context to close, may be {@code null}
+     */
+    public static void closeSilently(final Context context) {
+        try {
+            close(context);
+        } catch (final NamingException ignored) {
+            // ignored
+        }
+    }
+
+}

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/util/JndiCloser.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1610569&r1=1610568&r2=1610569&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Tue Jul 15 03:27:38 2014
@@ -21,6 +21,11 @@
     <title>Changes</title>
   </properties>
   <body>
+    <release version="?" date="2014-mm-dd" description="?">
+      <action issue="LOG4J2-713" dev="rpopma" type="fix">
+        Android: java.lang.VerifyError: org/apache/logging/log4j/core/util/Closer
+      </action>
+    </release> 
     <release version="2.0" date="2014-07-12" description="GA Release">
       <action issue="LOG4J2-705" dev="rpopma" type="fix">
         Fixed issue where Async Logger does not log thread context stack data.



Mime
View raw message