mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
[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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user