lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject svn commit: r1691421 - in /lucene/dev/trunk/lucene: CHANGES.txt misc/src/java/org/apache/lucene/index/SortingMergePolicy.java misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
Date Thu, 16 Jul 2015 17:15:19 GMT
Author: jpountz
Date: Thu Jul 16 17:15:18 2015
New Revision: 1691421

URL: http://svn.apache.org/r1691421
Log:
LUCENE-6681: SortingMergePolicy must override MergePolicy.size(...).

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/SortingMergePolicy.java
    lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1691421&r1=1691420&r2=1691421&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Thu Jul 16 17:15:18 2015
@@ -259,6 +259,9 @@ Bug fixes
 * LUCENE-6680: Preserve two suggestions that have same key and weight but
   different payloads (Arcadius Ahouansou via Mike McCandless)
 
+* LUCENE-6681: SortingMergePolicy must override MergePolicy.size(...).
+  (Christine Poerschke via Adrien Grand)
+
 Changes in Runtime Behavior
 
 * LUCENE-6501: The subreader structure in ParallelCompositeReader

Modified: lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/SortingMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/SortingMergePolicy.java?rev=1691421&r1=1691420&r2=1691421&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/SortingMergePolicy.java
(original)
+++ lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/SortingMergePolicy.java
Thu Jul 16 17:15:18 2015
@@ -261,6 +261,11 @@ public final class SortingMergePolicy ex
   }
 
   @Override
+  protected long size(SegmentCommitInfo info, IndexWriter writer) throws IOException {
+    return in.size(info, writer);
+  }
+
+  @Override
   public String toString() {
     return "SortingMergePolicy(" + in + ", sorter=" + sorter + ")";
   }

Modified: lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java?rev=1691421&r1=1691420&r2=1691421&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
(original)
+++ lucene/dev/trunk/lucene/misc/src/test/org/apache/lucene/index/TestSortingMergePolicy.java
Thu Jul 16 17:15:18 2015
@@ -18,6 +18,8 @@ package org.apache.lucene.index;
  */
 
 import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -192,4 +194,15 @@ public class TestSortingMergePolicy exte
     }
   }
 
+  public void testMethodsOverridden() throws Exception {
+    for (Method m : MergePolicy.class.getDeclaredMethods()) {
+      if (Modifier.isFinal(m.getModifiers())) continue;
+      try {
+        SortingMergePolicy.class.getDeclaredMethod(m.getName(),  m.getParameterTypes());
+      } catch (NoSuchMethodException e) {
+        fail("SortingMergePolicy needs to override '"+m+"'");
+      }
+    }
+  }
+
 }



Mime
View raw message