lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ABDOU Samir" <samir.ab...@unine.ch>
Subject Null Pointer Exception in clone method of TermVectorsReader class!
Date Fri, 19 Nov 2004 14:38:06 GMT

Hello everybody,

I got the null pointer exception in the method clone of the
TermVectorsReader class. Exactly in the given statement:    
clone.tvx = (IndexInput) tvx.clone();

This happens when trying to indexing.

I think that is due to the constructor of that class. 

  TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos)
    throws IOException {
    if (d.fileExists(segment + TermVectorsWriter.TVX_EXTENSION)) {
      tvx = d.openInput(segment + TermVectorsWriter.TVX_EXTENSION);
      checkValidFormat(tvx);
      tvd = d.openInput(segment + TermVectorsWriter.TVD_EXTENSION);
      tvdFormat = checkValidFormat(tvd);
      tvf = d.openInput(segment + TermVectorsWriter.TVF_EXTENSION);
      tvfFormat = checkValidFormat(tvf);
      size = (int) tvx.length() / 8;
    }
->    else {
->    	System.out.println("The file " + segment + " doesn't exist !");
->    }

    this.fieldInfos = fieldInfos;
  }
  
So my question: what happens when a segment doesn't exist!? I think that
the exception is due to this because tvx may be null in this case!

Thanks
Samir




---------------------------------------------------------------------
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