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 IndexWriter.java
Date Mon, 29 Nov 2004 20:41:01 GMT
bmesser     2004/11/29 12:41:01

  Modified:    src/java/org/apache/lucene/index IndexWriter.java
  Log:
  avoid NullpointerException if close() method is called twice. See Bugzilla: #32403
  Submitted by:	Wolf Siberski
  Reviewed by:	Bernhard Messer
  
  Revision  Changes    Path
  1.43      +4 -2      jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java
  
  Index: IndexWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- IndexWriter.java	18 Nov 2004 19:15:28 -0000	1.42
  +++ IndexWriter.java	29 Nov 2004 20:41:01 -0000	1.43
  @@ -338,8 +338,10 @@
     public synchronized void close() throws IOException {
       flushRamSegments();
       ramDirectory.close();
  -    writeLock.release();                          // release write lock
  -    writeLock = null;
  +    if (writeLock != null) {
  +      writeLock.release();                          // release write lock
  +      writeLock = null;
  +    }
       if(closeDir)
         directory.close();
     }
  
  
  

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