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.
This commit is contained in:
hns 2003-01-30 14:19:30 +00:00
parent 672ac0e7c1
commit a4e36e6ae3

View file

@ -512,7 +512,7 @@ public final class Node implements INode, Serializable {
} else { } else {
anonymous = true; anonymous = true;
} }
} else if (p.contains (this) > -1) { } else if (!anonymous && p.contains (this) > -1) {
anonymous = true; anonymous = true;
} }
} catch (Exception ignore) { } catch (Exception ignore) {
@ -892,7 +892,7 @@ public final class Node implements INode, Serializable {
public INode createNode (String nm, int where) { public INode createNode (String nm, int where) {
checkWriteLock (); checkWriteLock ();
boolean anon = false; boolean anon = false;
if (nm == null || "".equals (nm.trim ())) if (nm == null || "".equals (nm.trim ()))
anon = true; anon = true;
Node n = new Node (nm, null, nmgr); Node n = new Node (nm, null, nmgr);
@ -936,7 +936,7 @@ public final class Node implements INode, Serializable {
if (rel.otherType != null && rel.otherType.isRelational ()) if (rel.otherType != null && rel.otherType.isRelational ())
return (IPathElement) nmgr.getNode (this, name, rel); return (IPathElement) nmgr.getNode (this, name, rel);
else else
return (IPathElement) getNode (name); return (IPathElement) getNode (name);
} }
return (IPathElement) getSubnode (name); return (IPathElement) getSubnode (name);
} else { } else {