lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmes...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/index TermVectorsReader.java SegmentReader.java
Date Sun, 21 Nov 2004 22:32:50 GMT
bmesser     2004/11/21 14:32:49

  Modified:    src/java/org/apache/lucene/index TermVectorsReader.java
                        SegmentReader.java
  Log:
  Fix for bug: 31976, avoid NullPointerException when adding a document with an single, empty
field and term vectors enabled.
  
  Revision  Changes    Path
  1.7       +5 -1      jakarta-lucene/src/java/org/apache/lucene/index/TermVectorsReader.java
  
  Index: TermVectorsReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/TermVectorsReader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TermVectorsReader.java	6 Oct 2004 10:40:23 -0000	1.6
  +++ TermVectorsReader.java	21 Nov 2004 22:32:49 -0000	1.7
  @@ -295,6 +295,10 @@
     }
   
     protected Object clone() {
  +    
  +    if (tvx == null || tvd == null || tvf == null)
  +      return null;
  +    
       TermVectorsReader clone = null;
       try {
         clone = (TermVectorsReader) super.clone();
  
  
  
  1.35      +7 -1      jakarta-lucene/src/java/org/apache/lucene/index/SegmentReader.java
  
  Index: SegmentReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentReader.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- SegmentReader.java	18 Nov 2004 18:37:53 -0000	1.34
  +++ SegmentReader.java	21 Nov 2004 22:32:49 -0000	1.35
  @@ -489,6 +489,9 @@
         return null;
       
       TermVectorsReader termVectorsReader = getTermVectorsReader();
  +    if (termVectorsReader == null)
  +      return null;
  +    
       return termVectorsReader.get(docNumber, field);
     }
   
  @@ -505,6 +508,9 @@
         return null;
       
       TermVectorsReader termVectorsReader = getTermVectorsReader();
  +    if (termVectorsReader == null)
  +      return null;
  +    
       return termVectorsReader.get(docNumber);
     }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message