struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r680067 - in /struts/struts2/branches/STRUTS_2_0_X/core/src: main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java test/java/org/apache/struts2/views/jsp/SubsetIteratorTagTest.java
Date Sun, 27 Jul 2008 06:25:59 GMT
Author: wsmoak
Date: Sat Jul 26 23:25:58 2008
New Revision: 680067

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

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

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

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/SubsetIteratorTagTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/SubsetIteratorTagTest.java?rev=680067&r1=680066&r2=680067&view=diff
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/SubsetIteratorTagTest.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/SubsetIteratorTagTest.java
Sat Jul 26 23:25:58 2008
@@ -243,6 +243,21 @@
     }
 
 
+        public void testWithDoubleCount() throws Exception {
+            SubsetIteratorTag tag = new SubsetIteratorTag();
+            tag.setPageContext(pageContext);
+            tag.setCount("3.0");
+            tag.doStartTag();
+            tag.doEndTag();
+        }
+
+        public void testWithDoubleStart() throws Exception {
+            SubsetIteratorTag tag = new SubsetIteratorTag();
+            tag.setPageContext(pageContext);
+            tag.setStart("2.0");
+            tag.doStartTag();
+            tag.doEndTag();
+        }
 
     public Action getAction() {
         return new ActionSupport() {



Mime
View raw message