lock.release(this);
lock.release();
	private NodeSet[] getNodesRegexp(DocumentSet docs, String[] expr, int type) {		long start = System.currentTimeMillis();		ArraySet[] result = new ArraySet[expr.length];		Value ref;		StringBuffer term;		Collection collection;		short collectionId;		Pattern regexp;		WordsCallback cb;		Lock lock = dbWords.getLock();		for (int i = 0; i < expr.length; i++) {			if (expr[i] == null)				continue;			if (stoplist.contains(expr[i]))				continue;			expr[i] = expr[i].toLowerCase();			result[i] = new ArraySet(1000);			try {				regexp =					(type == DBBroker.MATCH_REGEXP						? regexCompiler.compile(expr[i], Perl5Compiler.CASE_INSENSITIVE_MASK)						: globCompiler.compile(							expr[i],							GlobCompiler.CASE_INSENSITIVE_MASK								| GlobCompiler.QUESTION_MATCHES_ZERO_OR_ONE_MASK));			} catch (MalformedPatternException e) {				LOG.debug(e);				continue;			}			term = new StringBuffer();			for (int j = 0; j < expr[i].length(); j++)				if (Character.isLetterOrDigit(expr[i].charAt(j)))					term.append(expr[i].charAt(j));				else					break;			cb = new WordsCallback(regexp, result[i], docs);			for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) {				collection = (Collection) iter.next();				collectionId = collection.getId();				if (term.length() > 0)					ref = new WordRef(collectionId, term.toString());				else					ref = new WordRef(collectionId);				IndexQuery query = new IndexQuery(null, IndexQuery.TRUNC_RIGHT, ref);				try {					lock.acquire(this);					lock.enter(this);					try {						dbWords.query(query, cb);					} catch (IOException ioe) {						LOG.debug(ioe);					} catch (BTreeException bte) {						LOG.debug(bte);					}				} catch (LockException e) {					LOG.debug(e);				} finally {					lock.release(this);				}			}			LOG.debug(				"regexp found: "					+ result[i].getLength()					+ " in "					+ (System.currentTimeMillis() - start)					+ "ms.");		}		return result;	}