From a99dc703a451d1ba7f47ae93f50d92e07fdbda43 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 1 Oct 2001 10:27:22 +0000 Subject: [PATCH] Check if the standard prototypes have been created after the first call of check(). --- src/helma/framework/core/TypeManager.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 97e5c713..5cc7b51a 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -123,6 +123,25 @@ public class TypeManager implements Runnable { zipped.update (); } } + + // check if standard prototypes have been created + // as a performance hack, we only do this when update is false, i.e. the first time we're called. + if (!update) { + for (Iterator it=standardTypes.iterator (); it.hasNext (); ) { + String pname = (String) it.next(); + if (prototypes.get (pname) == null) { + File f = new File (appDir, pname); + if (!f.exists() && !f.mkdir ()) + app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created."); + else if (!f.isDirectory ()) + app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory."); + Prototype proto = new Prototype (pname, app); + registerPrototype (pname, f, proto, update); + prototypes.put (pname, proto); + } + } + } + if (rewire) { // there have been changes in the DbMappings app.rewireDbMappings ();