lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject svn commit: r672568 - in /lucene/java/trunk/contrib/instantiated: CHANGES.txt src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
Date Sat, 28 Jun 2008 18:52:12 GMT
Author: kalle
Date: Sat Jun 28 11:52:12 2008
New Revision: 672568

URL: http://svn.apache.org/viewvc?rev=672568&view=rev
Log:
LUCENE-1318: InstantiatedIndexReader.norms(String, b[], int) didn't treat the array offset
right.

Modified:
    lucene/java/trunk/contrib/instantiated/CHANGES.txt
    lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java

Modified: lucene/java/trunk/contrib/instantiated/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/CHANGES.txt?rev=672568&r1=672567&r2=672568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/CHANGES.txt (original)
+++ lucene/java/trunk/contrib/instantiated/CHANGES.txt Sat Jun 28 11:52:12 2008
@@ -16,6 +16,9 @@
     and tests that assert that deleted documents behaves as they should (they did).
     (Jason Rutherglen, Karl Wettin)
 
+ 2. LUCENE-1318: InstantiatedIndexReader.norms(String, b[], int) didn't treat
+    the array offset right. (Jason Rutherglen via Karl Wettin)
+
 New features
 
  (None)

Modified: lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java?rev=672568&r1=672567&r2=672568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/java/org/apache/lucene/store/instantiated/InstantiatedIndexReader.java
Sat Jun 28 11:52:12 2008
@@ -294,7 +294,7 @@
 
   public void norms(String field, byte[] bytes, int offset) throws IOException {
     byte[] norms = getIndex().getNormsByFieldNameAndDocumentNumber().get(field);
-    System.arraycopy(norms, offset, bytes, 0, norms.length);
+    System.arraycopy(norms, 0, bytes, offset, norms.length);
   }
 
   protected void doSetNorm(int doc, String field, byte value) throws IOException {

Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java?rev=672568&r1=672567&r2=672568&view=diff
==============================================================================
--- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
(original)
+++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
Sat Jun 28 11:52:12 2008
@@ -252,6 +252,20 @@
       }
 
 
+      // test norms as used by multireader
+
+      aprioriNorms = new byte[aprioriReader.maxDoc() + 10];
+      aprioriReader.norms((String) field, aprioriNorms, 10);
+
+      testNorms = new byte[testReader.maxDoc() + 10];
+      testReader.norms((String) field, testNorms, 10);
+
+      assertEquals(aprioriNorms.length, testNorms.length);
+
+      for (int i = 0; i < aprioriNorms.length; i++) {
+        assertEquals("norms does not equals for field " + field + " in document " + i, aprioriNorms[i],
testNorms[i]);
+      }
+
     }
 
     for (int docIndex = 0; docIndex < aprioriReader.numDocs(); docIndex++) {



Mime
View raw message