struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r680066 - in /struts/struts2/branches/STRUTS_2_0_X/core/src: main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java
Date Sun, 27 Jul 2008 06:00:32 GMT
Author: wsmoak
Date: Sat Jul 26 23:00:31 2008
New Revision: 680066

URL: http://svn.apache.org/viewvc?rev=680066&view=rev
Log:
[WW-2734] Fix an impossible cast, reported by FindBugs.

Modified:
    struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java
    struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java?rev=680066&r1=680065&r2=680066&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java
Sat Jul 26 23:00:31 2008
@@ -205,7 +205,7 @@
                 count = ((Long)countObj).intValue();
             }
             else if (countObj instanceof Double) {
-                count = ((Long)countObj).intValue();
+                count = ((Double)countObj).intValue();
             }
             else if (countObj instanceof String) {
                 try {

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java?rev=680066&r1=680065&r2=680066&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/IteratorGeneratorTagTest.java
Sat Jul 26 23:00:31 2008
@@ -190,6 +190,14 @@
         assertNotSame(topOfStack, afterTopOfStack);
     }
 
+    public void testGeneratorWithDoubleCount() throws Exception {
+        IteratorGeneratorTag tag = new IteratorGeneratorTag();
+        tag.setPageContext(pageContext);
+        tag.setVal("%{'not used'}");
+        tag.setCount("3.0");
+        tag.doStartTag();
+        tag.doEndTag();
+    }
 
     public Action getAction() {
         return new ActionSupport() {



Mime
View raw message