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