Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Component/s: Paging/Sorting
-
Labels:None
-
Application server:Tomcat 5.5.9
Description
In our application, sometimes we provide PaginatedList instances to DisplayTag, and sometimes we don't. So depending on the action, the same table might be displaying a PaginatedList or a simple List.
To reproduce the problem, follow these steps in the same session:
1) Display table providing a simple List. It should work as expected.
2) Display the same table providing a PaginatedList. It should work as expected.
3) Display the same table providing a simple List. The results will NOT be what you expect. Rows from the previous step (2) will be visible.
The problem seems to be that the reference to the PaginatedList is not released. The code that seems to be causing this is on TableTag.java, line 855.
if (this.list instanceof PaginatedList)
{
this.paginatedList = (PaginatedList) this.list;
this.list = this.paginatedList.getList();
}
When the list is NOT a PaginatedList, the reference is not released, and the sole presence of a reference is what triggers the unexpected behaviour. The fix I propose (tested and seems to work fine) is:
if (this.list instanceof PaginatedList)
{
this.paginatedList = (PaginatedList) this.list;
this.list = this.paginatedList.getList();
} else {
this.paginatedList = null;
}
To reproduce the problem, follow these steps in the same session:
1) Display table providing a simple List. It should work as expected.
2) Display the same table providing a PaginatedList. It should work as expected.
3) Display the same table providing a simple List. The results will NOT be what you expect. Rows from the previous step (2) will be visible.
The problem seems to be that the reference to the PaginatedList is not released. The code that seems to be causing this is on TableTag.java, line 855.
if (this.list instanceof PaginatedList)
{
this.paginatedList = (PaginatedList) this.list;
this.list = this.paginatedList.getList();
}
When the list is NOT a PaginatedList, the reference is not released, and the sole presence of a reference is what triggers the unexpected behaviour. The fix I propose (tested and seems to work fine) is:
if (this.list instanceof PaginatedList)
{
this.paginatedList = (PaginatedList) this.list;
this.list = this.paginatedList.getList();
} else {
this.paginatedList = null;
}