struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1396971 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java
Date Thu, 11 Oct 2012 10:06:27 GMT
Author: lukaszlenart
Date: Thu Oct 11 10:06:26 2012
New Revision: 1396971

URL: http://svn.apache.org/viewvc?rev=1396971&view=rev
Log:
WW-3425 Improves if tests to simple test just one time

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java?rev=1396971&r1=1396970&r2=1396971&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java Thu Oct
11 10:06:26 2012
@@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletRes
  * <li>input: renders as html &lt;input type="reset"...&gt;</li>
  * <li>button: renders as html &lt;button type="reset"...&gt;</li>
  * </ul>
- * Please note that the button type has advantages by adding the possibility to seperate
the submitted value from the
+ * Please note that the button type has advantages by adding the possibility to separate
the submitted value from the
  * text shown on the button face, but has issues with Microsoft Internet Explorer at least
up to 6.0
  * <!-- END SNIPPET: javadoc -->
  *
@@ -50,7 +50,7 @@ import javax.servlet.http.HttpServletRes
  *
  * <pre>
  * <!-- START SNIPPET: example2 -->
- * Render an button reset:
+ * Render a reset button:
  * &lt;s:reset type="button" key="reset"/&gt;
  * <!-- END SNIPPET: example2 -->
  * </pre>
@@ -85,12 +85,8 @@ public class Reset extends FormButton {
     }
 
     public void evaluateParams() {
-        if ((key == null) && (value == null)) {
-            value = "Reset";
-        }
-
-        if (((key != null)) && (value == null)) {
-            this.value = "%{getText('"+key +"')}";
+        if (value == null) {
+            value = (key != null ? "%{getText('"+key+"')}" : "Reset");
         }
         super.evaluateParams();
     }
@@ -98,7 +94,7 @@ public class Reset extends FormButton {
     /**
      * Indicate whether the concrete button supports the type "image".
      *
-     * @return <tt>false</tt> to indicate type image is supported.
+     * @return <tt>false</tt> to indicate type image is not supported.
      */
     protected boolean supportsImageType() {
         return false;



Mime
View raw message