Iterator j = broker.getDOMIterator(doc, node.getGID());
Iterator j = broker.getDOMIterator(new NodeProxy(doc, node.getGID(), node.getInternalAddress()));
	public void removeDocument(DocumentImpl doc) {		LOG.debug("removing text index ...");		try {			HashSet words = new HashSet();			NodeList children = doc.getChildNodes();			NodeImpl node;			for (int i = 0; i < children.getLength(); i++) {				node = (NodeImpl) children.item(i);				Iterator j = broker.getDOMIterator(doc, node.getGID());				collect(words, j);			}			String word;			Value val;			WordRef ref;			byte[] data;			byte[] ndata;			VariableByteInputStream is;			VariableByteOutputStream os;			int len;			int docId;			long delta;			short collectionId = doc.getCollection().getId();			boolean changed;			Lock lock = dbWords.getLock();			for (Iterator iter = words.iterator(); iter.hasNext();) {				word = (String) iter.next();				ref = new WordRef(collectionId, word);				try {					lock.acquire(this, Lock.READ_LOCK);					lock.enter(this);					val = dbWords.get(ref);				} catch (LockException e) {					LOG.warn("could not acquire lock on words db", e);					val = null;				} finally {					lock.release(this);				}				if (val == null)					continue;				data = val.getData();				is = new VariableByteInputStream(data);				os = new VariableByteOutputStream();				changed = false;				try {					while (is.available() > 0) {						docId = is.readInt();						len = is.readInt();						if (docId != doc.getDocId()) {							// copy data to new buffer							os.writeInt(docId);							os.writeInt(len);							for (int j = 0; j < len; j++) {								delta = is.readLong();								os.writeLong(delta);							}						} else {							changed = true;							// skip							for (int j = 0; j < len; j++)								delta = is.readLong();						}					}				} catch (EOFException e) {				} catch (IOException e) {				}				if (changed) {					try {						lock.acquire(this, Lock.WRITE_LOCK);						lock.enter(this);						ndata = os.toByteArray();						if (ndata.length == 0) {							dbWords.remove(ref);						} else {							if (dbWords.put(ref, ndata) < 0)								LOG.debug("could not remove index for " + word);						}					} catch (LockException e) {						LOG.warn("could not acquire lock on words db", e);					} finally {						lock.release(this);					}				}			}			LOG.debug(words.size() + " words updated.");		} catch (ReadOnlyException e) {			LOG.warn("database is read-only");		}	}