Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.3.0-beta1, 1.3.0-beta2, 1.3.0-beta3, 1.3.0-beta4, 1.3.0-rc1, 1.3.0-rc2, 1.3.0-final, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4-M1, 1.4-M2, 1.4-M3, 1.4-RC1, 1.4-RC2, 1.4-RC3, 1.4-RC4, 1.4-RC5, 1.4-RC6, 1.4-RC7, 1.4.0, 1.4.1, 1.4.2, 1.4.3
-
None
Description
Referring to the post on the mailinglist (http://old.nabble.com/Unnecessary-method-calls-in-IDataProvider--ts26266771.html), here's a quick summary of the problem:
If the size() method of an IDataProvider returns zero, the iterator(int,int) method should not be called. Calling this method with value zero as second parameter (== count) always results in returning an empty iterator. Therefore a lot of unnecessary method calls (and thus a lot of unnecessary database hits) could be saved if an empty iterator would be used by the DataView whenever size() returns an int <= 0.
Please find a project attached with a junit test that illustrates the problem. I tested it with all major releases from 1.4.3. down to 1.3.0. with the same result.