actually a bit too simplistic. We do have to check the element name for
non-relational objects after all. But all that was needed was to do it right,
i.e. to check if parent.contains(this) before setting this to anonymous.
This commit is contained in:
hns 2003-07-14 14:38:16 +00:00
parent 4cc4742d6c
commit b6fb19c935

View file

@ -391,8 +391,7 @@ public final class Node implements INode, Serializable {
// if subnodes are also mounted as properties, try to get the "nice" prop value // if subnodes are also mounted as properties, try to get the "nice" prop value
// instead of the id by turning the anonymous flag off. // instead of the id by turning the anonymous flag off.
long lastmod = Math.max(dbmap.getLastTypeChange(), lastmodified); long lastmod = Math.max(dbmap.getLastTypeChange(), lastmodified);
if ((parentHandle != null) && (lastNameCheck < lastmod) && if ((parentHandle != null) && (lastNameCheck < lastmod)) {
(dbmap != null) && (dbmap.isRelational())) {
try { try {
Node p = parentHandle.getNode(nmgr); Node p = parentHandle.getNode(nmgr);
DbMapping parentmap = p.getDbMapping(); DbMapping parentmap = p.getDbMapping();
@ -407,16 +406,17 @@ public final class Node implements INode, Serializable {
anonymous = false; anonymous = false;
// nameProp = localrel.propName; // nameProp = localrel.propName;
} else { } else if (!anonymous && (p.contains(this) > -1)) {
anonymous = true; anonymous = true;
} }
} else if (!anonymous && (p.contains(this) > -1)) { } else if (!anonymous && (p.contains(this) > -1)) {
anonymous = true; anonymous = true;
} }
} catch (Exception ignore) { } catch (Exception ignore) {
// FIXME: add proper NullPointer checks in try statement
// just fall back to default method // just fall back to default method
} }
lastNameCheck = System.currentTimeMillis(); lastNameCheck = System.currentTimeMillis();
} }