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

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@680066 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Wendy Smoak
2008-07-27 06:00:31 +00:00
parent 061d23071a
commit 6cda019a6c
2 changed files with 9 additions and 1 deletions
@@ -205,7 +205,7 @@ public class IteratorGeneratorTag 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 {
@@ -190,6 +190,14 @@ public class IteratorGeneratorTagTest extends AbstractTagTest {
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() {