logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1587349 - in /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j: LogManager.java ThreadContext.java util/ProviderUtil.java
Date Mon, 14 Apr 2014 22:41:58 GMT
Author: mattsicker
Date: Mon Apr 14 22:41:57 2014
New Revision: 1587349

URL: http://svn.apache.org/r1587349
Log:
Change ProviderUtil.getProviders() to return Iterable.

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java?rev=1587349&r1=1587348&r2=1587349&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java
Mon Apr 14 22:41:57 2014
@@ -17,7 +17,6 @@
 package org.apache.logging.log4j;
 
 import java.net.URI;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -74,9 +73,7 @@ public class LogManager {
             final SortedMap<Integer, LoggerContextFactory> factories = new TreeMap<Integer,
LoggerContextFactory>();
 
             if (ProviderUtil.hasProviders()) {
-                final Iterator<Provider> providers = ProviderUtil.getProviders();
-                while (providers.hasNext()) {
-                    final Provider provider = providers.next();
+                for (final Provider provider : ProviderUtil.getProviders()) {
                     final String className = provider.getClassName();
                     if (className != null) {
                         try {

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java?rev=1587349&r1=1587348&r2=1587349&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
Mon Apr 14 22:41:57 2014
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -91,9 +90,7 @@ public final class ThreadContext  {
         }
         if (contextMap == null && ProviderUtil.hasProviders()) {
             final LoggerContextFactory factory = LogManager.getFactory();
-            final Iterator<Provider> providers = ProviderUtil.getProviders();
-            while (providers.hasNext()) {
-                final Provider provider = providers.next();
+            for (final Provider provider : ProviderUtil.getProviders()) {
                 threadContextMapName = provider.getThreadContextMap();
                 final String factoryClassName = provider.getClassName();
                 if (threadContextMapName != null && factory.getClass().getName().equals(factoryClassName))
{

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java?rev=1587349&r1=1587348&r2=1587349&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
Mon Apr 14 22:41:57 2014
@@ -21,7 +21,6 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Properties;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.spi.Provider;
@@ -71,8 +70,8 @@ public final class ProviderUtil {
         }
     }
 
-    public static Iterator<Provider> getProviders() {
-        return PROVIDERS.iterator();
+    public static Iterable<Provider> getProviders() {
+        return PROVIDERS;
     }
 
     public static boolean hasProviders() {



Mime
View raw message