You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2014/10/03 11:06:49 UTC

svn commit: r1629152 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java

Author: mikemccand
Date: Fri Oct  3 09:06:48 2014
New Revision: 1629152

URL: http://svn.apache.org/r1629152
Log:
do not accept null delegate in FilterLeafReader.Filter*

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java?rev=1629152&r1=1629151&r2=1629152&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java Fri Oct  3 09:06:48 2014
@@ -65,6 +65,9 @@ public class FilterLeafReader extends Le
      * @param in the underlying Fields instance.
      */
     public FilterFields(Fields in) {
+      if (in == null) {
+        throw new NullPointerException("incoming Fields cannot be null");
+      }
       this.in = in;
     }
 
@@ -98,6 +101,9 @@ public class FilterLeafReader extends Le
      * @param in the underlying Terms instance.
      */
     public FilterTerms(Terms in) {
+      if (in == null) {
+        throw new NullPointerException("incoming Terms cannot be null");
+      }
       this.in = in;
     }
 
@@ -156,7 +162,12 @@ public class FilterLeafReader extends Le
      * Creates a new FilterTermsEnum
      * @param in the underlying TermsEnum instance.
      */
-    public FilterTermsEnum(TermsEnum in) { this.in = in; }
+    public FilterTermsEnum(TermsEnum in) {
+      if (in == null) {
+        throw new NullPointerException("incoming TermsEnum cannot be null");
+      }
+      this.in = in;
+    }
 
     @Override
     public AttributeSource attributes() {
@@ -219,6 +230,9 @@ public class FilterLeafReader extends Le
      * @param in the underlying DocsEnum instance.
      */
     public FilterDocsEnum(DocsEnum in) {
+      if (in == null) {
+        throw new NullPointerException("incoming DocsEnum cannot be null");
+      }
       this.in = in;
     }
 
@@ -263,6 +277,9 @@ public class FilterLeafReader extends Le
      * @param in the underlying DocsAndPositionsEnum instance.
      */
     public FilterDocsAndPositionsEnum(DocsAndPositionsEnum in) {
+      if (in == null) {
+        throw new NullPointerException("incoming DocsAndPositionsEnum cannot be null");
+      }
       this.in = in;
     }
 
@@ -327,6 +344,9 @@ public class FilterLeafReader extends Le
    */
   public FilterLeafReader(LeafReader in) {
     super();
+    if (in == null) {
+      throw new NullPointerException("incoming LeafReader cannot be null");
+    }
     this.in = in;
     in.registerParentReader(this);
   }