improve specificity of error messages

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-02-25 22:54:08 +00:00
parent 563c9da606
commit 00ab5bacc6
1 changed files with 9 additions and 4 deletions

View File

@ -65,10 +65,15 @@ public class FilteredQuery extends Query {
* @see FilterStrategy
*/
public FilteredQuery(Query query, Filter filter, FilterStrategy strategy) {
if (query == null || filter == null)
throw new IllegalArgumentException("Query and filter cannot be null.");
if (strategy == null)
throw new IllegalArgumentException("FilterStrategy can not be null");
if (query == null) {
throw new IllegalArgumentException("Query must not be be null.");
}
if (filter == null) {
throw new IllegalArgumentException("Filter must not be be null.");
}
if (strategy == null) {
throw new IllegalArgumentException("FilterStrategy must not be null");
}
this.strategy = strategy;
this.query = query;
this.filter = filter;