lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [01/50] lucene-solr:jira/solr-12181: LUCENE-8196: Check for a null input in LowpassIntervalsSource
Date Tue, 10 Apr 2018 14:11:40 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-12181 2f13a21f2 -> 751987d53


LUCENE-8196: Check for a null input in LowpassIntervalsSource


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/7117b68d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7117b68d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7117b68d

Branch: refs/heads/jira/solr-12181
Commit: 7117b68db6835acfeda17f04ab2c20a8c1ec2c17
Parents: 34b83ed
Author: Alan Woodward <romseygeek@apache.org>
Authored: Wed Apr 4 09:37:32 2018 +0100
Committer: Alan Woodward <romseygeek@apache.org>
Committed: Wed Apr 4 09:38:19 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/lucene/search/intervals/IntervalFilter.java   | 3 ++-
 .../apache/lucene/search/intervals/LowpassIntervalsSource.java    | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7117b68d/lucene/sandbox/src/java/org/apache/lucene/search/intervals/IntervalFilter.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/intervals/IntervalFilter.java
b/lucene/sandbox/src/java/org/apache/lucene/search/intervals/IntervalFilter.java
index d1d2fcf..7571fc2 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/search/intervals/IntervalFilter.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/search/intervals/IntervalFilter.java
@@ -18,6 +18,7 @@
 package org.apache.lucene.search.intervals;
 
 import java.io.IOException;
+import java.util.Objects;
 
 /**
  * Wraps an {@link IntervalIterator} and passes through those intervals that match the {@link
#accept()} function
@@ -30,7 +31,7 @@ public abstract class IntervalFilter extends IntervalIterator {
    * Create a new filter
    */
   public IntervalFilter(IntervalIterator in) {
-    this.in = in;
+    this.in = Objects.requireNonNull(in);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7117b68d/lucene/sandbox/src/java/org/apache/lucene/search/intervals/LowpassIntervalsSource.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/intervals/LowpassIntervalsSource.java
b/lucene/sandbox/src/java/org/apache/lucene/search/intervals/LowpassIntervalsSource.java
index 3bb469e..4d7846c 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/search/intervals/LowpassIntervalsSource.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/search/intervals/LowpassIntervalsSource.java
@@ -56,6 +56,9 @@ class LowpassIntervalsSource extends IntervalsSource {
   @Override
   public IntervalIterator intervals(String field, LeafReaderContext ctx) throws IOException
{
     IntervalIterator i = in.intervals(field, ctx);
+    if (i == null) {
+      return null;
+    }
     return new IntervalFilter(i) {
       @Override
       protected boolean accept() {


Mime
View raw message