Added check to make sure that all code resources are returned at any point in time (i.e. even in application startup phase, when prototype has maybe never been updated before). (cherry picking from commit 5880fc27d323b82f508e5b5234999ebbd9bbb4ad)

This commit is contained in:
Daniel Ruthardt 2010-12-07 21:11:59 +01:00 committed by Tobi Schäfer
parent eda05c731a
commit 7cafee58c4

View file

@ -415,6 +415,11 @@ public final class Prototype {
* @return an iterator of this prototype's code resources
*/
public synchronized Iterator getCodeResources() {
// if code has never been updated, do so now before returning an empty or incomplete list
if (lastCodeUpdate == 0) {
checkForUpdates();
}
// we copy over to a new list, because the underlying set may grow
// during compilation through use of app.addRepository()
return new ArrayList(code).iterator();