lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beard, Brian" <Brian.Be...@mybir.com>
Subject org.apache.lucene.index.CheckIndex minor fix
Date Fri, 21 Dec 2007 20:00:00 GMT
I have used the org.apache.lucene.index.CheckIndex class in the trunk
version of the source which seems to work well.

There was one minor issue with it hanging on to the segment*'s file
after the method is called (w/o the fixing option).

There is one change I did which clears this up by a adding a finally
block to close the IndexInput.

/** old version from line 88 **/
    try {
      format = input.readInt();
    } catch (Throwable t) {
      out.println("ERROR: could not read segment file version in
directory");
      t.printStackTrace(out);
      return false;
    }

/** updated version **/
    try {
      format = input.readInt();
    } catch (Throwable t) {
      out.println("ERROR: could not read segment file version in
directory");
      t.printStackTrace(out);
      return false;
    } finally {
    	if (input != null) {
    		input.close();
    	}
    }



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


Mime
View raw message