lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r889678 - in /lucene/java/branches/flex_1458_3_0_back_compat_tests: ./ contrib/ contrib/highlighter/src/test/ src/java/org/apache/lucene/search/ src/java/org/apache/lucene/store/ src/test/org/apache/lucene/analysis/ src/test/org/apache/luce...
Date Fri, 11 Dec 2009 16:11:43 GMT
Author: markrmiller
Date: Fri Dec 11 16:11:42 2009
New Revision: 889678

URL: http://svn.apache.org/viewvc?rev=889678&view=rev
Log:
LUCENE-1458: (flex) merge back compat tests up to r888615

Modified:
    lucene/java/branches/flex_1458_3_0_back_compat_tests/   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/CHANGES.txt   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/CHANGES.txt   (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/highlighter/src/test/   (props
changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMDirectory.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMFile.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderClone.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/store/MockRAMDirectory.java
    lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java
  (props changed)

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests:818601-821336
 /lucene/java/branches/lucene_3_0:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests:880869-889631
 /lucene/java/trunk:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/CHANGES.txt:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/CHANGES.txt:818601-821336
 /lucene/java/branches/lucene_3_0/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
-/lucene/java/trunk/CHANGES.txt:881213,881315,881466,881819,882374,882464,882807,882888,882977,883074-883075
+/lucene/java/branches/lucene_3_0_back_compat_tests/CHANGES.txt:880869-889631
+/lucene/java/trunk/CHANGES.txt:881213,881315,881466,881819,882374,882464,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib:817269-818600,825998,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib:818601-821336
 /lucene/java/branches/lucene_3_0/contrib:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib:880869-889631
 /lucene/java/trunk/contrib:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib/CHANGES.txt:817269-818600,825998,826775,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/CHANGES.txt:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/CHANGES.txt:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/CHANGES.txt:880869-889631
 /lucene/java/trunk/contrib/CHANGES.txt:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/contrib/highlighter/src/test/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/contrib/highlighter/src/test:817269-818600,825998,826775,829134,829816,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/contrib/highlighter/src/test:818601-821336
 /lucene/java/branches/lucene_3_0/contrib/highlighter/src/test:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/contrib/highlighter/src/test:880869-889631
 /lucene/java/trunk/contrib/highlighter/src/test:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:880869-889631
 /lucene/java/trunk/src/java/org/apache/lucene/search/MultiTermQueryWrapperFilter.java:881213,881315,881466,881819,881984,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMDirectory.java?rev=889678&r1=889677&r2=889678&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMDirectory.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMDirectory.java
Fri Dec 11 16:11:42 2009
@@ -22,6 +22,7 @@
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
 import org.apache.lucene.util.ThreadInterruptedException;
 
 /**
@@ -34,7 +35,7 @@
   private static final long serialVersionUID = 1l;
 
   HashMap<String,RAMFile> fileMap = new HashMap<String,RAMFile>();
-  long sizeInBytes = 0;
+  final AtomicLong sizeInBytes = new AtomicLong();
   
   // *****
   // Lock acquisition sequence:  RAMDirectory, then RAMFile
@@ -153,7 +154,7 @@
    * RAMOutputStream.BUFFER_SIZE. */
   public synchronized final long sizeInBytes() {
     ensureOpen();
-    return sizeInBytes;
+    return sizeInBytes.get();
   }
   
   /** Removes an existing file in the directory.
@@ -166,7 +167,7 @@
     if (file!=null) {
         fileMap.remove(name);
         file.directory = null;
-        sizeInBytes -= file.sizeInBytes;       // updates to RAMFile.sizeInBytes synchronized
on directory
+        sizeInBytes.addAndGet(-file.sizeInBytes);
     } else
       throw new FileNotFoundException(name);
   }
@@ -179,7 +180,7 @@
     synchronized (this) {
       RAMFile existing = fileMap.get(name);
       if (existing!=null) {
-        sizeInBytes -= existing.sizeInBytes;
+        sizeInBytes.addAndGet(existing.sizeInBytes);
         existing.directory = null;
       }
       fileMap.put(name, file);

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMFile.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMFile.java?rev=889678&r1=889677&r2=889678&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMFile.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/java/org/apache/lucene/store/RAMFile.java
Fri Dec 11 16:11:42 2009
@@ -62,7 +62,7 @@
     if (directory!=null)
       synchronized (directory) {             // Ensure addition of buffer and adjustment
to directory size are atomic wrt directory
         buffers.add(buffer);
-        directory.sizeInBytes += size;
+        directory.sizeInBytes.getAndAdd(size);
         sizeInBytes += size;
       }
     else

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -1,4 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:880869-889631
 /lucene/java/trunk/src/test/org/apache/lucene/analysis/TestISOLatin1AccentFilter.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -1,4 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestDateTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestDateTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestDateTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestDateTools.java:880869-889631
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestDateTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -1,4 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/document/TestNumberTools.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/document/TestNumberTools.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/document/TestNumberTools.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/document/TestNumberTools.java:880869-889631
 /lucene/java/trunk/src/test/org/apache/lucene/document/TestNumberTools.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -1,4 +1,5 @@
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:748824
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:825998,829134,829881,831036
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:880869-889631
 /lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,885214

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderClone.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderClone.java?rev=889678&r1=889677&r2=889678&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderClone.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderClone.java
Fri Dec 11 16:11:42 2009
@@ -314,95 +314,12 @@
     TestIndexReaderReopen.createIndex(dir1, false);
     SegmentReader origSegmentReader = SegmentReader.getOnlySegmentReader(dir1);
     origSegmentReader.deleteDocument(10);
-    assertDelDocsRefCountEquals(1, origSegmentReader);
     origSegmentReader.undeleteAll();
-    assertNull(origSegmentReader.deletedDocsRef);
     origSegmentReader.close();
     // need to test norms?
     dir1.close();
   }
   
-  public void testSegmentReaderCloseReferencing() throws Exception {
-    final Directory dir1 = new MockRAMDirectory();
-    TestIndexReaderReopen.createIndex(dir1, false);
-    SegmentReader origSegmentReader = SegmentReader.getOnlySegmentReader(dir1);
-    origSegmentReader.deleteDocument(1);
-    origSegmentReader.setNorm(4, "field1", 0.5f);
-
-    SegmentReader clonedSegmentReader = (SegmentReader) origSegmentReader
-        .clone();
-    assertDelDocsRefCountEquals(2, origSegmentReader);
-    origSegmentReader.close();
-    assertDelDocsRefCountEquals(1, origSegmentReader);
-    // check the norm refs
-    Norm norm = clonedSegmentReader.norms.get("field1");
-    assertEquals(1, norm.bytesRef().refCount());
-    clonedSegmentReader.close();
-    dir1.close();
-  }
-  
-  public void testSegmentReaderDelDocsReferenceCounting() throws Exception {
-    final Directory dir1 = new MockRAMDirectory();
-    TestIndexReaderReopen.createIndex(dir1, false);
-
-    IndexReader origReader = IndexReader.open(dir1, false);
-    SegmentReader origSegmentReader = SegmentReader.getOnlySegmentReader(origReader);
-    // deletedDocsRef should be null because nothing has updated yet
-    assertNull(origSegmentReader.deletedDocsRef);
-
-    // we deleted a document, so there is now a deletedDocs bitvector and a
-    // reference to it
-    origReader.deleteDocument(1);
-    assertDelDocsRefCountEquals(1, origSegmentReader);
-
-    // the cloned segmentreader should have 2 references, 1 to itself, and 1 to
-    // the original segmentreader
-    IndexReader clonedReader = (IndexReader) origReader.clone();
-    SegmentReader clonedSegmentReader = SegmentReader.getOnlySegmentReader(clonedReader);
-    assertDelDocsRefCountEquals(2, origSegmentReader);
-    // deleting a document creates a new deletedDocs bitvector, the refs goes to
-    // 1
-    clonedReader.deleteDocument(2);
-    assertDelDocsRefCountEquals(1, origSegmentReader);
-    assertDelDocsRefCountEquals(1, clonedSegmentReader);
-
-    // make sure the deletedocs objects are different (copy
-    // on write)
-    assertTrue(origSegmentReader.deletedDocs != clonedSegmentReader.deletedDocs);
-
-    assertDocDeleted(origSegmentReader, clonedSegmentReader, 1);
-    assertTrue(!origSegmentReader.isDeleted(2)); // doc 2 should not be deleted
-                                                  // in original segmentreader
-    assertTrue(clonedSegmentReader.isDeleted(2)); // doc 2 should be deleted in
-                                                  // cloned segmentreader
-
-    // deleting a doc from the original segmentreader should throw an exception
-    try {
-      origReader.deleteDocument(4);
-      fail("expected exception");
-    } catch (LockObtainFailedException lbfe) {
-      // expected
-    }
-
-    origReader.close();
-    // try closing the original segment reader to see if it affects the
-    // clonedSegmentReader
-    clonedReader.deleteDocument(3);
-    clonedReader.flush();
-    assertDelDocsRefCountEquals(1, clonedSegmentReader);
-
-    // test a reopened reader
-    IndexReader reopenedReader = clonedReader.reopen();
-    IndexReader cloneReader2 = (IndexReader) reopenedReader.clone();
-    SegmentReader cloneSegmentReader2 = SegmentReader.getOnlySegmentReader(cloneReader2);
-    assertDelDocsRefCountEquals(2, cloneSegmentReader2);
-    clonedReader.close();
-    reopenedReader.close();
-    cloneReader2.close();
-
-    dir1.close();
-  }
-
   // LUCENE-1648
   public void testCloneWithDeletes() throws Throwable {
     final Directory dir1 = new MockRAMDirectory();
@@ -446,10 +363,6 @@
     assertEquals(reader.isDeleted(doc), reader2.isDeleted(doc));
   }
 
-  private void assertDelDocsRefCountEquals(int refCount, SegmentReader reader) {
-    assertEquals(refCount, reader.deletedDocsRef.refCount());
-  }
-  
   public void testCloneSubreaders() throws Exception {
     final Directory dir1 = new MockRAMDirectory();
  

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java?rev=889678&r1=889677&r2=889678&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
Fri Dec 11 16:11:42 2009
@@ -173,68 +173,13 @@
     SegmentReader reader1 = SegmentReader.getOnlySegmentReader(dir1);
     reader1.norms("field1");
     Norm r1norm = reader1.norms.get("field1");
-    SegmentReader.Ref r1BytesRef = r1norm.bytesRef();
     SegmentReader reader2 = (SegmentReader)reader1.clone();
-    assertEquals(2, r1norm.bytesRef().refCount());
     reader1.close();
-    assertEquals(1, r1BytesRef.refCount());
     reader2.norms("field1");
     reader2.close();
     dir1.close();
   }
   
-  public void testNormsRefCounting() throws IOException { 
-    Directory dir1 = new MockRAMDirectory(); 
-    TestIndexReaderReopen.createIndex(dir1, false);
-    IndexReader reader1 = IndexReader.open(dir1, false);
-        
-    IndexReader reader2C = (IndexReader) reader1.clone();
-    SegmentReader segmentReader2C = SegmentReader.getOnlySegmentReader(reader2C);
-    segmentReader2C.norms("field1"); // load the norms for the field
-    Norm reader2CNorm = segmentReader2C.norms.get("field1");
-    assertTrue("reader2CNorm.bytesRef()=" + reader2CNorm.bytesRef(), reader2CNorm.bytesRef().refCount()
== 2);
-    
-    
-    
-    IndexReader reader3C = (IndexReader) reader2C.clone();
-    SegmentReader segmentReader3C = SegmentReader.getOnlySegmentReader(reader3C);
-    Norm reader3CCNorm = segmentReader3C.norms.get("field1");
-    assertEquals(3, reader3CCNorm.bytesRef().refCount());
-    
-    // edit a norm and the refcount should be 1
-    IndexReader reader4C = (IndexReader) reader3C.clone();
-    SegmentReader segmentReader4C = SegmentReader.getOnlySegmentReader(reader4C);
-    assertEquals(4, reader3CCNorm.bytesRef().refCount());
-    reader4C.setNorm(5, "field1", 0.33f);
-    
-    // generate a cannot update exception in reader1
-    try {
-      reader3C.setNorm(1, "field1", 0.99f);
-      fail("did not hit expected exception");
-    } catch (Exception ex) {
-      // expected
-    }
-    
-    // norm values should be different 
-    assertTrue(Similarity.decodeNorm(segmentReader3C.norms("field1")[5]) != Similarity.decodeNorm(segmentReader4C.norms("field1")[5]));
-    Norm reader4CCNorm = segmentReader4C.norms.get("field1");
-    assertEquals(3, reader3CCNorm.bytesRef().refCount());
-    assertEquals(1, reader4CCNorm.bytesRef().refCount());
-        
-    IndexReader reader5C = (IndexReader) reader4C.clone();
-    SegmentReader segmentReader5C = SegmentReader.getOnlySegmentReader(reader5C);
-    Norm reader5CCNorm = segmentReader5C.norms.get("field1");
-    reader5C.setNorm(5, "field1", 0.7f);
-    assertEquals(1, reader5CCNorm.bytesRef().refCount());    
-
-    reader5C.close();
-    reader4C.close();
-    reader3C.close();
-    reader2C.close();
-    reader1.close();
-    dir1.close();
-  }
-  
   private void createIndex(Directory dir) throws IOException {
     IndexWriter iw = new IndexWriter(dir, anlzr, true,
         IndexWriter.MaxFieldLength.LIMITED);

Modified: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/store/MockRAMDirectory.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/store/MockRAMDirectory.java?rev=889678&r1=889677&r2=889678&view=diff
==============================================================================
--- lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/store/MockRAMDirectory.java
(original)
+++ lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/store/MockRAMDirectory.java
Fri Dec 11 16:11:42 2009
@@ -213,7 +213,7 @@
       throw new IOException("file " + name + " already exists");
     else {
       if (existing!=null) {
-        sizeInBytes -= existing.sizeInBytes;
+        sizeInBytes.getAndAdd(-existing.sizeInBytes);
         existing.directory = null;
       }
 

Propchange: lucene/java/branches/flex_1458_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 11 16:11:42 2009
@@ -2,4 +2,5 @@
 /lucene/java/branches/lucene_2_9/src/test/org/apache/lucene/util/TestAttributeSource.java:817269-818600,825998,829134,829881,831036
 /lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:818601-821336
 /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/util/TestAttributeSource.java:880754,880793,880823,881216,881317,881376,881473,881549,881820,882467,882890,883076,883080
+/lucene/java/branches/lucene_3_0_back_compat_tests/src/test/org/apache/lucene/util/TestAttributeSource.java:880869-889631
 /lucene/java/trunk/src/test/org/apache/lucene/util/TestAttributeSource.java:881213,881315,881466,881819,882374,882807,882888,882977,883074-883075,883079,885214



Mime
View raw message