Unnecessary method calls in IDataProvider
-----------------------------------------

                 Key: WICKET-2568
                 URL: https://issues.apache.org/jira/browse/WICKET-2568
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.4-RC7, 1.4-RC6, 1.4-RC5, 
1.4-RC4, 1.4-RC3, 1.4-RC2, 1.4-RC1, 1.4-M3, 1.4-M2, 1.4-M1, 1.3.7, 1.3.6, 
1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0-final, 1.3.0-rc2, 1.3.0-rc1, 
1.3.0-beta4, 1.3.0-beta3, 1.3.0-beta2, 1.3.0-beta1
            Reporter: Michael Sparer


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to