struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r438176 - in /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components: Else.java ElseIf.java If.java
Date Tue, 29 Aug 2006 19:35:55 GMT
Author: tmjee
Date: Tue Aug 29 12:35:54 2006
New Revision: 438176

URL: http://svn.apache.org/viewvc?rev=438176&view=rev
Log:
WW-1422
 - Else tag body displayed when it shouldn't
 - commit a better fix, such that the changes lies in If.java, Else.java and ElseIf.java are
rolled back to their original state.

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Else.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ElseIf.java
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/If.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Else.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Else.java?rev=438176&r1=438175&r2=438176&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Else.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Else.java Tue Aug
29 12:35:54 2006
@@ -61,11 +61,9 @@
     public boolean start(Writer writer) {
         Map context = stack.getContext();
         Boolean ifResult = (Boolean) context.get(If.ANSWER);
-        ifResult = ifResult == null ? Boolean.FALSE : ifResult;
 
         context.remove(If.ANSWER);
 
-        //return !((ifResult == null) || (ifResult.booleanValue()));
-        return ! ifResult.booleanValue();
+        return !((ifResult == null) || (ifResult.booleanValue()));
     }
 }

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ElseIf.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ElseIf.java?rev=438176&r1=438175&r2=438176&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ElseIf.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/ElseIf.java Tue
Aug 29 12:35:54 2006
@@ -67,10 +67,8 @@
 
     public boolean start(Writer writer) {
         Boolean ifResult = (Boolean) stack.getContext().get(If.ANSWER);
-        ifResult = ifResult == null ? Boolean.FALSE : ifResult;
         
-        //if ((ifResult == null) || (ifResult.booleanValue())) {
-        if (ifResult.booleanValue()) {
+        if ((ifResult == null) || (ifResult.booleanValue())) {
             return false;
         }
 

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/If.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/If.java?rev=438176&r1=438175&r2=438176&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/If.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/If.java Tue Aug
29 12:35:54 2006
@@ -84,7 +84,7 @@
         if (answer == null) {
             answer = Boolean.FALSE;
         }
-        
+        stack.getContext().put(ANSWER, answer);
         return answer.booleanValue();
     }
 



Mime
View raw message