
| Key: |
DISPL-375
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Major
|
| Reporter: |
Michael Watts
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
I am getting a ClassCastException in org.displaytag.model.HeaderCell.addToTotal when value for cell is the empty string "". This is a problem when totaling a column using the total="true" attribute on ColumnTag.
This method should be changed to avoid this problem. Here is my proposed:
Original:
=====
private void addToTotal(Object value)
{
if (value != null)
{
this.total = this.total + ((Number) value).doubleValue();
}
}
=====
Proposal:
=====
private void addToTotal(Object value)
{
if (value != null && value instanceof Number)
{
this.total = this.total + ((Number) value).doubleValue();
}
}
=====
|
|
Description
|
I am getting a ClassCastException in org.displaytag.model.HeaderCell.addToTotal when value for cell is the empty string "". This is a problem when totaling a column using the total="true" attribute on ColumnTag.
This method should be changed to avoid this problem. Here is my proposed:
Original:
=====
private void addToTotal(Object value)
{
if (value != null)
{
this.total = this.total + ((Number) value).doubleValue();
}
}
=====
Proposal:
=====
private void addToTotal(Object value)
{
if (value != null && value instanceof Number)
{
this.total = this.total + ((Number) value).doubleValue();
}
}
===== |
Show » |
Sort Order:
|