struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcucchi...@apache.org
Subject svn commit: r1131315 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
Date Sat, 04 Jun 2011 05:16:31 GMT
Author: mcucchiara
Date: Sat Jun  4 05:16:30 2011
New Revision: 1131315

URL: http://svn.apache.org/viewvc?rev=1131315&view=rev
Log:
Removed needless double check in log

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java?rev=1131315&r1=1131314&r2=1131315&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
Sat Jun  4 05:16:30 2011
@@ -21,15 +21,13 @@
 
 package org.apache.struts2.util;
 
+import com.opensymphony.xwork2.TextProvider;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
-import com.opensymphony.xwork2.TextProvider;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.LinkedList;
 import java.util.Collections;
+import java.util.List;
 
 /**
  * Helper methods to access text from TextProviders
@@ -71,9 +69,7 @@ public class TextProviderHelper {
         String msg = null;
         TextProvider tp = null;
 
-        for (Iterator iterator = stack.getRoot().iterator(); iterator.hasNext();) {
-            Object o = iterator.next();
-
+        for (Object o : stack.getRoot()) {
             if (o instanceof TextProvider) {
                 tp = (TextProvider) o;
                 msg = tp.getText(key, null, args, stack);
@@ -94,22 +90,14 @@ public class TextProviderHelper {
 
             if (LOG.isWarnEnabled()) {
                 if (tp != null) {
-                    if (LOG.isWarnEnabled()) {
                 	LOG.warn("The first TextProvider in the ValueStack ("+tp.getClass().getName()+")
could not locate the message resource with key '"+key+"'");
-                    }
                 } else {
-                    if (LOG.isWarnEnabled()) {
                 	LOG.warn("Could not locate the message resource '"+key+"' as there is no
TextProvider in the ValueStack.");
-                    }
                 }
                 if (msg.equals(defaultMessage)) {
-                    if (LOG.isWarnEnabled()) {
                 	LOG.warn("The default value expression '"+defaultMessage+"' was evaluated
and did not match a property.  The literal value '"+defaultMessage+"' will be used.");
-                    }
                 } else {
-                    if (LOG.isWarnEnabled()) {
                 	LOG.warn("The default value expression '"+defaultMessage+"' evaluated to
'"+msg+"'");
-                    }
                 }
             }
         }



Mime
View raw message