From 7cafee58c4925dcd7a6f96a542298295f45124e4 Mon Sep 17 00:00:00 2001 From: Daniel Ruthardt Date: Tue, 7 Dec 2010 21:11:59 +0100 Subject: [PATCH] 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) --- src/main/java/helma/framework/core/Prototype.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/helma/framework/core/Prototype.java b/src/main/java/helma/framework/core/Prototype.java index 30b67516..022cf05d 100644 --- a/src/main/java/helma/framework/core/Prototype.java +++ b/src/main/java/helma/framework/core/Prototype.java @@ -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();