words = new TreeMap();
words.clear();
		public void reindex(DocumentImpl oldDoc) {			final short collectionId = doc.getCollection().getId();			int count = 1, len;			Map.Entry entry;			String word;			LongLinkedList idList;			long[] ids;			byte[] data;			long prevId;			long delta;			NodeSet oldList;			DocumentSet docs;			NodeProxy p;			WordRef ref;			Lock lock;			String[] terms = new String[1];			for (Iterator i = words.entrySet().iterator();				i.hasNext();				count++) {				entry = (Map.Entry) i.next();				word = (String) entry.getKey();				terms[0] = word;				idList = (LongLinkedList) entry.getValue();				docs = new DocumentSet();				docs.add(oldDoc);				oldList = getNodesExact(docs, terms)[0];				for (Iterator j = oldList.iterator(); j.hasNext();) {					p = (NodeProxy) j.next();					if (oldDoc.getTreeLevel(p.gid) < oldDoc.reindexRequired())						idList.add(p.gid);				}				ids = idList.getData();				i.remove();				Arrays.sort(ids);				len = ids.length;				os.writeInt(doc.getDocId());				os.writeInt(len);				prevId = 0;				for (int j = 0; j < len; j++) {					delta = ids[j] - prevId;					if (delta < 0) {						LOG.debug("neg. delta: " + delta + " for " + word);						LOG.debug("id = " + ids[j] + "; prev = " + prevId);					}					os.writeLong(delta);					prevId = ids[j];				}				data = os.toByteArray();				os.clear();				ref = new WordRef(collectionId, word);				lock = dbWords.getLock();				try {					lock.acquire(this, Lock.WRITE_LOCK);					lock.enter(this);					try {						dbWords.put(ref, data);					} catch (ReadOnlyException e) {					}				} catch (LockException e) {					LOG.warn("could not acquire lock", e);				} finally {					lock.release(this);				}			}			words = new TreeMap();		}