mirror of https://github.com/apache/lucene.git
LUCENE-689: NullPointerException thrown by equals method in SpanOrQuery
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@750009 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90f52a651e
commit
480c2afd15
|
@ -121,7 +121,7 @@ public class SpanOrQuery extends SpanQuery {
|
|||
final SpanOrQuery that = (SpanOrQuery) o;
|
||||
|
||||
if (!clauses.equals(that.clauses)) return false;
|
||||
if (!field.equals(that.field)) return false;
|
||||
if (!clauses.isEmpty() && !field.equals(that.field)) return false;
|
||||
|
||||
return getBoost() == that.getBoost();
|
||||
}
|
||||
|
|
|
@ -318,6 +318,10 @@ public class TestSpans extends LuceneTestCase {
|
|||
public void testSpanOrEmpty() throws Exception {
|
||||
Spans spans = orSpans(new String[0]);
|
||||
assertFalse("empty next", spans.next());
|
||||
|
||||
SpanOrQuery a = new SpanOrQuery( new SpanQuery[0] );
|
||||
SpanOrQuery b = new SpanOrQuery( new SpanQuery[0] );
|
||||
assertTrue("empty should equal", a.equals(b));
|
||||
}
|
||||
|
||||
public void testSpanOrSingle() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue