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:
parent
eda05c731a
commit
7cafee58c4
1 changed files with 5 additions and 0 deletions
|
@ -415,6 +415,11 @@ public final class Prototype {
|
||||||
* @return an iterator of this prototype's code resources
|
* @return an iterator of this prototype's code resources
|
||||||
*/
|
*/
|
||||||
public synchronized Iterator getCodeResources() {
|
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
|
// we copy over to a new list, because the underlying set may grow
|
||||||
// during compilation through use of app.addRepository()
|
// during compilation through use of app.addRepository()
|
||||||
return new ArrayList(code).iterator();
|
return new ArrayList(code).iterator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue