lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bergstrand <stefan.bergstr...@polopoly.com>
Subject ArrayIndexOutOfBoundsException in QueryParser
Date Thu, 30 May 2002 09:20:26 GMT

I don't know if this has occurred on this mailing list before; but to
be sure, here it is.


I dont know what the query was, but someone managed to trick the
parser into the following exeception :


java.lang.ArrayIndexOutOfBoundsException: -1 < 0
        at java.util.Vector.elementAt(Vector.java:427)
        at org.apache.lucene.queryParser.QueryParser.addClause(Unknown Source)
        at org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
        at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
        at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
        at
com.polopoly.search.lucene.LuceneIndexSearcher.search(LuceneIndexSearcher.java:294)


As far as I can see, it has to be here:

 if (conj == CONJ_AND) {
      BooleanClause c = (BooleanClause) clauses.elementAt(clauses.size()-1);
      if (!c.prohibited)
        c.required = true;
 }


So, obviously, addClause() is called with an empty "clauses" Vector
and "conj" set to CONJ_AND.


Should not be possible, should it?

/Stefan B


-- 
---------------------------
Stefan Bergstrand
Polopoly - Cultivating the information garden
Ph:   +46 8 506 782 67
Cell: +46 704 47 82 67
Fax:  +46 8 506 782 51
stefan.bergstrand@polopoly.com, http://www.polopoly.com

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message