From 20e8bb8987e5026033138a075c9bfa47952ef861 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 6 Mar 2001 21:51:53 +0000 Subject: [PATCH] Fixed bug where SkinFile would always return true on needsUpdate() when the skin object wasnt initialized. --- src/helma/framework/core/SkinFile.java | 2 +- src/helma/framework/core/TypeManager.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/helma/framework/core/SkinFile.java b/src/helma/framework/core/SkinFile.java index 89cb3c43..532c9793 100644 --- a/src/helma/framework/core/SkinFile.java +++ b/src/helma/framework/core/SkinFile.java @@ -35,7 +35,7 @@ public class SkinFile implements Updatable { * the file has been modified or deleted. */ public boolean needsUpdate () { - return lastmod != file.lastModified () || !file.exists (); + return (skin != null && lastmod != file.lastModified ()) || !file.exists (); } diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 3b572ad2..134ed713 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -232,8 +232,9 @@ public class TypeManager implements Runnable { // our plan is to do as little as possible, so first check if anything has changed at all... for (Iterator i = proto.updatables.values().iterator(); i.hasNext(); ) { Updatable upd = (Updatable) i.next(); - if (upd.needsUpdate ()) + if (upd.needsUpdate ()) { needsUpdate = true; + } } String list[] = dir.list(); @@ -241,8 +242,9 @@ public class TypeManager implements Runnable { String fn = list[i]; if (!proto.updatables.containsKey (fn)) { if (fn.endsWith (app.templateExtension) || fn.endsWith (app.scriptExtension) || - fn.endsWith (app.actionExtension) || fn.endsWith (app.scriptExtension) || "type.properties".equalsIgnoreCase (fn)) + fn.endsWith (app.actionExtension) || fn.endsWith (app.scriptExtension) || "type.properties".equalsIgnoreCase (fn)) { needsUpdate = true; + } } } @@ -251,6 +253,7 @@ public class TypeManager implements Runnable { // let the thread know we had to do something. idleSeconds = 0; + app.logEvent ("TypeManager: Updating prototypes for "+app.getName()); // first go through new files and create new items for (int i=0; i