lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r925626 - /lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
Date Sat, 20 Mar 2010 15:15:36 GMT
Author: markrmiller
Date: Sat Mar 20 15:15:34 2010
New Revision: 925626

URL: http://svn.apache.org/viewvc?rev=925626&view=rev
Log:
tweaks

Modified:
    lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java

Modified: lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java?rev=925626&r1=925625&r2=925626&view=diff
==============================================================================
--- lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
(original)
+++ lucene/solr/branches/newtrunk/solr/src/java/org/apache/solr/core/RefCntRamDirectory.java
Sat Mar 20 15:15:34 2010
@@ -7,37 +7,35 @@ import org.apache.lucene.store.Directory
 import org.apache.lucene.store.RAMDirectory;
 
 public class RefCntRamDirectory extends RAMDirectory {
-  
+
   private final AtomicInteger refCount = new AtomicInteger();
-  
+
   public RefCntRamDirectory() {
     super();
-    incRef();
+    refCount.set(1);
   }
 
   public RefCntRamDirectory(Directory dir) throws IOException {
     this();
     Directory.copy(dir, this, false);
   }
-  
+
   public void incRef() {
     ensureOpen();
     refCount.incrementAndGet();
   }
-  
+
   public void decRef() {
     ensureOpen();
     if (refCount.getAndDecrement() == 1) {
       super.close();
     }
   }
-  
+
   public final synchronized void close() {
-    if (isOpen) {
-      decRef();
-    }
+    decRef();
   }
-  
+
   public boolean isOpen() {
     return isOpen;
   }



Mime
View raw message