[WW-2734] Fix impossible casts, reported by FindBugs.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@680067 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Wendy Smoak
2008-07-27 06:25:58 +00:00
parent 6cda019a6c
commit f382908469
2 changed files with 17 additions and 2 deletions
@@ -214,7 +214,7 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
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 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport {
start = ((Long)startObj).intValue();
}
else if (startObj instanceof Double) {
start = ((Long)startObj).intValue();
start = ((Double)startObj).intValue();
}
else if (startObj instanceof String) {
try {
@@ -243,6 +243,21 @@ public class SubsetIteratorTagTest extends AbstractTagTest {
}
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() {