Code changed in jenkins
User: Jesse Glick
Path:
core/src/test/java/jenkins/model/lazy/AbstractLazyLoadRunMapTest.java
core/src/test/java/jenkins/model/lazy/FakeMap.java
http://jenkins-ci.org/commit/jenkins/2f58ceb1a66c8ed621fa2562c5ed3445b29ea200
Log:
JENKINS-18065 Uncommenting original test.
The actual implementation does not behave as nicely as one would hope, for a few reasons:
1. isEmpty actually tries to load the newestBuild, rather than simply checking whether there is some idOnDisk.
Arguably this is necessary, since there could be an unloadable build record, in which case it would be technically correct for the map to be considered empty.
2. Loading AbstractLazyLoadRunMap.newestBuild calls search(MAX_VALUE, DESC), which behaves oddly, by doing a binary search, and thus perhaps loading lg(|map|) entries.
You would think that it would suffice to check for the last member of idOnDisk in index.byId.
3. The iterator eagerly loads the next value before hasNext has even been called.
Looks bad in a test, though it probably has little practical impact since most callers would be calling hasNext soon afterward anyway.
Might cause one extra build record to be loaded unnecessarily from a limited RunList.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to