From: Wolfgang M. M. <wol...@us...> - 2004-06-16 09:23:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3994/src/org/exist/dom Modified Files: ElementImpl.java NodeImpl.java Log Message: Wrong page links in dom.dbx: some pages got lost after a number of xupdate remove/append operations. Index: ElementImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ElementImpl.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ElementImpl.java 8 Jun 2004 08:16:07 -0000 1.36 --- ElementImpl.java 16 Jun 2004 09:23:48 -0000 1.37 *************** *** 276,282 **** DocumentImpl prevDoc = new DocumentImpl(ownerDocument); Node node = null; ! if (children == 0) ! node = appendChildren(firstChildID(), this, getPath(), nodes, true); ! else { if(child == 1) { Node firstChild = getFirstChild(); --- 276,283 ---- DocumentImpl prevDoc = new DocumentImpl(ownerDocument); Node node = null; ! if (children == 0) { ! // no children: append a new child ! node = appendChildren(firstChildID(), this, getPath(), nodes, true); ! } else { if(child == 1) { Node firstChild = getFirstChild(); *************** *** 1166,1175 **** final int level = ownerDocument.getTreeLevel(gid); final DocumentImpl prevDoc = new DocumentImpl(ownerDocument); removeAll(old, old.getPath().toString()); --children; ownerDocument.broker.endRemove(); ownerDocument.broker.update(this); ! ownerDocument.reindex = level + 1; ! ownerDocument.broker.reindex(prevDoc, ownerDocument, this); return old; } --- 1167,1179 ---- final int level = ownerDocument.getTreeLevel(gid); final DocumentImpl prevDoc = new DocumentImpl(ownerDocument); + final long lastChild = lastChildID(); removeAll(old, old.getPath().toString()); --children; ownerDocument.broker.endRemove(); ownerDocument.broker.update(this); ! if(old.gid < lastChild) { ! ownerDocument.reindex = level + 1; ! ownerDocument.broker.reindex(prevDoc, ownerDocument, this); ! } return old; } Index: NodeImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/NodeImpl.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NodeImpl.java 8 Jun 2004 08:16:07 -0000 1.23 --- NodeImpl.java 16 Jun 2004 09:23:48 -0000 1.24 *************** *** 102,106 **** return CommentImpl.deserialize(data, start, len, pooled); default : ! LOG.debug("not implemented"); return null; } --- 102,106 ---- return CommentImpl.deserialize(data, start, len, pooled); default : ! LOG.debug("Unknown node type: " + type); return null; } |