TableView icon indicating copy to clipboard operation
TableView copied to clipboard

Pagination - List.size() on a null object reference

Open Xirate opened this issue 6 years ago • 4 comments

Hey, so I found this new bug called NullPointerException when I try to use pagination. I attempt to set all data, set the adapter to tableview - it works perfectly, but when I try to add pagination, with default page size of 5 it doesn't seem to work - it just displays all data as it did before, what is more, when I try to call next or previousPage() it crashes with exception stated in title. After some code checking it seems you actually don't ever initialize originalCellData list in Pagination class, it seems to be copied when you use any filtering or sorting, but if there aren't any, as in my case, it seems to have a problem. Also, there is unused generic class parameter, causes awkward fails :v (just remove the < T > next to Pagination class definition)

Xirate avatar Nov 13 '18 14:11 Xirate

hello I have same problem with that, how to solved?

tomeroto avatar Jul 13 '19 09:07 tomeroto

The T parameter on the Pagination class has been removed in https://github.com/evrencoskun/TableView/commit/01ff663a6bedde0f76795f28bfec27774381a290#diff-0a6c8317f96a580b02498bc0ed6f2c1f, and will be part of the next release.

I was able to reproduce your issue from the v0.8.8 tag, but not from the master branch. So I guess the issue is fixed, and it will also be part of the next release.

MGaetan89 avatar Dec 05 '19 13:12 MGaetan89

Hi @Xirate. The new version (v0.8.9) was release in January. Did you have a chance to try it to see if it fixes your issue?

MGaetan89 avatar Mar 29 '20 14:03 MGaetan89

Oh boy :D Well, you know, I don't have anything better to do now during what is going on with the world now and I see you also found time to make a fix XD I'll try that next days, if I forget to, remind me please, because it will be a first bugfix I contribute to :D

Xirate avatar Mar 29 '20 21:03 Xirate