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