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 QueryParser).
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?
Thanks, jp
[1] http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1158980
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]