commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1129355 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginCreateRule.java
Date Mon, 30 May 2011 20:36:13 GMT
Author: simonetripodi
Date: Mon May 30 20:36:13 2011
New Revision: 1129355

URL: http://svn.apache.org/viewvc?rev=1129355&view=rev
Log:
used collection's isEmpty() proper method to check input lists are not empty
used proper Java5 iterators

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

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginCreateRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginCreateRule.java?rev=1129355&r1=1129354&r2=1129355&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginCreateRule.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/PluginCreateRule.java
Mon May 30 20:36:13 2011
@@ -518,15 +518,14 @@ public class PluginCreateRule
         throws Exception
     {
 
-        if ( ( rules != null ) && ( rules.size() > 0 ) )
+        if ( ( rules != null ) && ( !rules.isEmpty() ) )
         {
             Log log = getDigester().getLogger();
             boolean debug = log.isDebugEnabled();
-            for ( int i = 0; i < rules.size(); i++ )
+            for ( Rule rule : rules )
             {
                 try
                 {
-                    Rule rule = rules.get( i );
                     if ( debug )
                     {
                         log.debug( "  Fire begin() for " + rule );
@@ -561,15 +560,14 @@ public class PluginCreateRule
     private void fireBodyMethods( List<Rule> rules, String namespaceURI, String name,
String text )
         throws Exception
     {
-        if ( ( rules != null ) && ( rules.size() > 0 ) )
+        if ( ( rules != null ) && ( !rules.isEmpty() ) )
         {
             Log log = getDigester().getLogger();
             boolean debug = log.isDebugEnabled();
-            for ( int i = 0; i < rules.size(); i++ )
+            for ( Rule rule : rules )
             {
                 try
                 {
-                    Rule rule = rules.get( i );
                     if ( debug )
                     {
                         log.debug( "  Fire body() for " + rule );



Mime
View raw message