commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1129372 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java
Date Mon, 30 May 2011 21:08:09 GMT
Author: simonetripodi
Date: Mon May 30 21:08:09 2011
New Revision: 1129372

URL: http://svn.apache.org/viewvc?rev=1129372&view=rev
Log:
improved Java5 iterators

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java?rev=1129372&r1=1129371&r2=1129372&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginManager.java
Mon May 30 21:08:09 2011
@@ -22,10 +22,8 @@ package org.apache.commons.digester3.plu
 import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
-import java.util.Iterator;
 
 import org.apache.commons.digester3.Digester;
-
 import org.apache.commons.logging.Log;
 
 /**
@@ -173,23 +171,21 @@ public class PluginManager
 
         List<RuleFinder> ruleFinders = pluginContext.getRuleFinders();
         RuleLoader ruleLoader = null;
-        try
+        for ( RuleFinder finder : ruleFinders )
         {
-            for ( Iterator<RuleFinder> i = ruleFinders.iterator(); i.hasNext() &&
ruleLoader == null; )
+            if ( debug )
+            {
+                log.debug( "checking finder of type " + finder.getClass().getName() );
+            }
+            try
             {
-
-                RuleFinder finder = i.next();
-                if ( debug )
-                {
-                    log.debug( "checking finder of type " + finder.getClass().getName() );
-                }
                 ruleLoader = finder.findLoader( digester, pluginClass, props );
             }
-        }
-        catch ( PluginException e )
-        {
-            throw new PluginException( "Unable to locate plugin rules for plugin" + " with
id [" + id + "]"
-                + ", and class [" + pluginClass.getName() + "]" + ":" + e.getMessage(), e.getCause()
);
+            catch ( PluginException e )
+            {
+                throw new PluginException( "Unable to locate plugin rules for plugin" + "
with id [" + id + "]"
+                    + ", and class [" + pluginClass.getName() + "]" + ":" + e.getMessage(),
e.getCause() );
+            }
         }
         log.debug( "scanned ruleFinders." );
 



Mime
View raw message