From: Wolfgang M. M. <wol...@us...> - 2004-05-10 11:23:22
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/xupdate Modified Files: XUpdateProcessor.java Modification.java Update.java Append.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. Index: XUpdateProcessor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/XUpdateProcessor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** XUpdateProcessor.java 30 Apr 2004 09:08:12 -0000 1.21 --- XUpdateProcessor.java 10 May 2004 11:22:38 -0000 1.22 *************** *** 92,95 **** --- 92,107 ---- } + public XUpdateProcessor() throws ParserConfigurationException { + this(null, null); + } + + public void setBroker(DBBroker broker) { + this.broker = broker; + } + + public void setDocumentSet(DocumentSet docs) { + this.documentSet = docs; + } + /** * Parse the input source into a set of modifications. *************** *** 391,397 **** throws SAXException { if (inModification) { ! if (inAttribute) ! ((Attr) currentNode).setValue(new String(ch, start, length)); ! else { charBuf.append(ch, start, length); } --- 403,415 ---- throws SAXException { if (inModification) { ! if (inAttribute) { ! Attr attr = (Attr)currentNode; ! String val = attr.getValue(); ! if(val == null) ! val = new String(ch, start, length); ! else ! val += new String(ch, start, length); ! attr.setValue(val); ! } else { charBuf.append(ch, start, length); } *************** *** 568,570 **** --- 586,604 ---- } + public void reset() { + inModification = false; + inAttribute = false; + modification = null; + doc = null; + fragment = null; + stack.clear(); + currentNode = null; + broker = null; + documentSet = null; + modifications.clear(); + charBuf.setLength(0); + variables.clear(); + namespaces.clear(); + namespaces.put("xml", "http://www.w3.org/XML/1998/namespace"); + } } Index: Modification.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/Modification.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Modification.java 23 Apr 2004 13:07:47 -0000 1.21 --- Modification.java 10 May 2004 11:22:38 -0000 1.22 *************** *** 86,90 **** throw new EXistException("select expression should evaluate to a" + "node-set"); NodeList set = (NodeList)resultSeq; ! LOG.info("found " + set.getLength() + " for select; retrieving nodes..."); ArrayList out = new ArrayList(set.getLength()); for (int i = 0; i < set.getLength(); i++) { --- 86,90 ---- throw new EXistException("select expression should evaluate to a" + "node-set"); NodeList set = (NodeList)resultSeq; ! LOG.info("found " + set.getLength() + " for select: " + selectStmt + "; retrieving nodes..."); ArrayList out = new ArrayList(set.getLength()); for (int i = 0; i < set.getLength(); i++) { Index: Update.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/Update.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Update.java 29 Jan 2004 15:06:45 -0000 1.11 --- Update.java 10 May 2004 11:22:38 -0000 1.12 *************** *** 81,84 **** --- 81,88 ---- case Node.ATTRIBUTE_NODE : parent = (ElementImpl)node.getParentNode(); + if(parent == null) { + LOG.warn("parent node not found for " + node.getGID()); + break; + } AttrImpl attr = (AttrImpl)node; if (children.getLength() != 0) { Index: Append.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/Append.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Append.java 30 Apr 2004 09:08:12 -0000 1.13 --- Append.java 10 May 2004 11:22:38 -0000 1.14 *************** *** 41,49 **** if (qr == null || children.getLength() == 0) return 0; IndexListener listener = new IndexListener(qr); NodeImpl node; DocumentImpl doc = null; Collection collection = null, prevCollection = null; - int len = children.getLength(); for(int i = 0; i < qr.length; i++) { node = qr[i]; --- 41,49 ---- if (qr == null || children.getLength() == 0) return 0; + IndexListener listener = new IndexListener(qr); NodeImpl node; DocumentImpl doc = null; Collection collection = null, prevCollection = null; for(int i = 0; i < qr.length; i++) { node = qr[i]; |