From: Wolfgang M. M. <wol...@us...> - 2004-06-29 14:26:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30306/src/org/exist/dom Modified Files: DocumentImpl.java Log Message: Fixed bug in automatic defragmentation method leading to random exceptions (like "node not found", "not implemented" etc.). Index: DocumentImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/DocumentImpl.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** DocumentImpl.java 23 Jun 2004 12:44:17 -0000 1.45 --- DocumentImpl.java 29 Jun 2004 14:26:48 -0000 1.46 *************** *** 66,69 **** --- 66,71 ---- public final static byte BINARY_FILE = 1; + public final static byte DOCUMENT_NODE_SIGNATURE = 0x0F; + private transient NodeIndexListener listener = NullNodeIndexListener.INSTANCE; *************** *** 670,673 **** --- 672,676 ---- final VariableByteOutputStream ostream = new VariableByteOutputStream(7); try { + ostream.writeByte(DOCUMENT_NODE_SIGNATURE); if(children > 0) { for(int i = 0; i < children; i++) { *************** *** 692,695 **** --- 695,704 ---- VariableByteArrayInput istream = new VariableByteArrayInput(data); try { + byte signature = istream.readByte(); + if(signature != DOCUMENT_NODE_SIGNATURE) { + LOG.error("Could not read document metadata for document " + fileName + + " ( " + docId + "): not a metadata node."); + return; + } childList = new long[children]; for (int i = 0; i < children; i++) { *************** *** 703,707 **** pageCount = istream.readInt(); } catch (IOException e) { ! LOG.warn("io error while reading document data", e); } } --- 712,716 ---- pageCount = istream.readInt(); } catch (IOException e) { ! LOG.warn("io error while reading document data for document " + fileName, e); } } |