You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2012/10/11 12:06:27 UTC
svn commit: r1396971 -
/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Reset.java
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 <input type="reset"...></li>
* <li>button: renders as html <button type="reset"...></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:
* <s:reset type="button" key="reset"/>
* <!-- 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;