From a4e36e6ae3ecd8dd364e6c23b2948a1e697894e1 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 30 Jan 2003 14:19:30 +0000 Subject: [PATCH] Don't call contains() on the parent node in getElementName() unless necessary, i.e. unless we actually think we are accessed by access name. Some minor formatting fixes. --- src/helma/objectmodel/db/Node.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 3fa33e5d..2b8ca0d4 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -512,7 +512,7 @@ public final class Node implements INode, Serializable { } else { anonymous = true; } - } else if (p.contains (this) > -1) { + } else if (!anonymous && p.contains (this) > -1) { anonymous = true; } } catch (Exception ignore) { @@ -892,13 +892,13 @@ public final class Node implements INode, Serializable { public INode createNode (String nm, int where) { checkWriteLock (); - boolean anon = false; - if (nm == null || "".equals (nm.trim ())) + boolean anon = false; + if (nm == null || "".equals (nm.trim ())) anon = true; Node n = new Node (nm, null, nmgr); if (anon) addNode (n, where); - else + else setNode (nm, n); return n; } @@ -936,7 +936,7 @@ public final class Node implements INode, Serializable { if (rel.otherType != null && rel.otherType.isRelational ()) return (IPathElement) nmgr.getNode (this, name, rel); else - return (IPathElement) getNode (name); + return (IPathElement) getNode (name); } return (IPathElement) getSubnode (name); } else {