From 29e9f745e189b04c766dc28abe93e2edd90db1af Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 10 Aug 2001 18:10:23 +0000 Subject: [PATCH] Fixed a bug where object prototypes were not created with proper parent prototypes --- src/helma/framework/core/Prototype.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/helma/framework/core/Prototype.java b/src/helma/framework/core/Prototype.java index 3655b89f..9be75b0e 100644 --- a/src/helma/framework/core/Prototype.java +++ b/src/helma/framework/core/Prototype.java @@ -84,7 +84,8 @@ public class Prototype { if (opp == null) opp = reval.esNodePrototype; op.setPrototype (opp); - } catch (Exception ignore) {} + } catch (Exception ignore) { + } } } } @@ -124,15 +125,25 @@ public class Prototype { public void initRequestEvaluator (RequestEvaluator reval) { + // see if we already registered with this evaluator + if (reval.getPrototype (name) != null) + return; + ObjectPrototype op = null; // get the prototype's prototype if possible and necessary ObjectPrototype opp = null; - if (prototype != null) + if (prototype != null) { + // see if parent prototype is already registered. if not, register it opp = reval.getPrototype (prototype.getName ()); - if (!"global".equalsIgnoreCase (name) && - !"hopobject".equalsIgnoreCase (name) && opp == null) + if (opp == null) { + prototype.initRequestEvaluator (reval); + opp = reval.getPrototype (prototype.getName ()); + } + } + if (!"global".equalsIgnoreCase (name) && !"hopobject".equalsIgnoreCase (name) && opp == null) { opp = reval.esNodePrototype; + } if ("user".equalsIgnoreCase (name)) { op = reval.esUserPrototype;