Skip to content

Apache Lucene open-source search software

fix UOE exc in base Query.createWeight to include this.toString in its message

Michael McCandless2f50268803ce
diff --git a/lucene/src/java/org/apache/lucene/search/Query.java b/lucene/src/java/org/apache/lucene/search/Query.java
index 714b62836a4..d4a8d4372b5 100644
--- a/lucene/src/java/org/apache/lucene/search/Query.java
+++ b/lucene/src/java/org/apache/lucene/search/Query.java
@@ -88,7 +88,7 @@ public abstract class Query implements Cloneable {
* Only implemented by primitive queries, which re-write to themselves.
*/
public Weight createWeight(IndexSearcher searcher) throws IOException {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("Query " + this + " does not implement createWeight");
}
/** Expert: called to re-write queries into primitive queries. For example,