From d8190ed3b223cff0582a5c704bf383128d44cdd8 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 23 Sep 2002 14:27:32 +0000 Subject: [PATCH] Fix: Don't set parent prototype in prototypes unless it is exlicitly defined in type.properties file. If it isn't explicitly defined, the scripting engine will check the right runtime parent prototype depending on whether the prototype is a HopObject or Java object prototype. --- src/helma/framework/core/TypeManager.java | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 1686d145..e99b0d13 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -65,20 +65,6 @@ public final class TypeManager { registerPrototype (pname, new File (appDir, pname), proto); } } - Prototype hobjectProto = getPrototype ("hopobject"); - // loop through freshly created prototypes and rewire them, - // i.e. establish connections between them (inherit, collection etc.) - for (Iterator i = prototypes.values().iterator(); i.hasNext(); ) { - Prototype proto = (Prototype) i.next(); - DbMapping dbm = proto.getDbMapping (); - dbm.update (); - // set parent prototype - String parentName = dbm.getExtends (); - if (parentName == null) - proto.setParentPrototype (hobjectProto); - else - proto.setParentPrototype (getPrototype (parentName)); - } } @@ -138,9 +124,10 @@ public final class TypeManager { dbmap.update (); // set parent prototype, in case it has changed. String parentName = dbmap.getExtends (); - if (parentName == null) - parentName = "hopobject"; - proto.setParentPrototype (getPrototype (parentName)); + if (parentName != null) + proto.setParentPrototype (getPrototype (parentName)); + else + proto.setParentPrototype (null); } }