lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Pipitone <>
Subject Why does BooleanQuery$TooManyClauses extend RuntimeException?
Date Tue, 25 Nov 2003 23:50:23 GMT
Hey all,

When I switched over to Lucene 1.3 RC2 I found that a user of my 
application could create an unhandled exception, just by entering in a 
wild card query.  (There was a post today about this [1]).

The exception being thrown when a wildcard query causes a BooleanQuery 
to grow too large, BooleanQuery$TooManyClauses, extends 
RuntimeException.  As such, the method throwing it -- BooleanQuery.add() 
-- doesn't need to declare that it throws it, nor if it did would there 
be any compilation errors if the caller does not catch it.

My application was using QueryParser as before, and there were no 
compile time errors to indicate that I would need to catch this sort of 
exception.  Of course, it is in the javadoc (but of BooleanQuery not 

My question is, if throwing BooleanQuery$TooManyClauses is part of the 
API (which it seems like it is implicitly) then shouldn't it be enforced 
at compile time? What about wrapping this sort of exception in a 
ParseException so that it can be handled like all other parse exceptions?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message