You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/06/17 20:37:52 UTC

svn commit: r1493871 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java core/src/java/org/apache/solr/core/SolrDeletionPolicy.java

Author: shalin
Date: Mon Jun 17 18:37:52 2013
New Revision: 1493871

URL: http://svn.apache.org/r1493871
Log:
SOLR-4931: SolrDeletionPolicy onInit and onCommit methods changed to override exact signatures (with generics) from IndexDeletionPolicy

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1493871&r1=1493870&r2=1493871&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Jun 17 18:37:52 2013
@@ -196,7 +196,10 @@ Other Changes
   (Philip Hoy via Robert Muir)
   
 * SOLR-4224: Refactor JavaBinCodec input stream definition to enhance reuse.
-  (phunt via Mark Miller)  
+  (phunt via Mark Miller)
+
+* SOLR-4931: SolrDeletionPolicy onInit and onCommit methods changed to override
+  exact signatures (with generics) from IndexDeletionPolicy (shalin)
 
 ==================  4.3.1 ==================
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java?rev=1493871&r1=1493870&r2=1493871&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java Mon Jun 17 18:37:52 2013
@@ -100,7 +100,7 @@ public final class IndexDeletionPolicyWr
     }
   }
 
-  private List<IndexCommitWrapper> wrap(List<IndexCommit> list) {
+  private List<IndexCommitWrapper> wrap(List<? extends IndexCommit> list) {
     List<IndexCommitWrapper> result = new ArrayList<IndexCommitWrapper>();
     for (IndexCommit indexCommit : list) result.add(new IndexCommitWrapper(indexCommit));
     return result;
@@ -130,7 +130,7 @@ public final class IndexDeletionPolicyWr
    * Internal use for Lucene... do not explicitly call.
    */
   @Override
-  public void onInit(List list) throws IOException {
+  public void onInit(List<? extends IndexCommit> list) throws IOException {
     List<IndexCommitWrapper> wrapperList = wrap(list);
     deletionPolicy.onInit(wrapperList);
     updateCommitPoints(wrapperList);
@@ -141,7 +141,7 @@ public final class IndexDeletionPolicyWr
    * Internal use for Lucene... do not explicitly call.
    */
   @Override
-  public void onCommit(List list) throws IOException {
+  public void onCommit(List<? extends IndexCommit> list) throws IOException {
     List<IndexCommitWrapper> wrapperList = wrap(list);
     deletionPolicy.onCommit(wrapperList);
     updateCommitPoints(wrapperList);

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java?rev=1493871&r1=1493870&r2=1493871&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java Mon Jun 17 18:37:52 2013
@@ -77,7 +77,7 @@ public class SolrDeletionPolicy extends 
    * Internal use for Lucene... do not explicitly call.
    */
   @Override
-  public void onInit(List commits) throws IOException {
+  public void onInit(List<? extends IndexCommit> commits) throws IOException {
     // SOLR-4547: log basic data at INFO, add filenames at DEBUG.
     if (commits.isEmpty()) {
       return;
@@ -86,26 +86,26 @@ public class SolrDeletionPolicy extends 
         new CommitsLoggingInfo(commits));
     log.debug("SolrDeletionPolicy.onInit: commits: {}",
         new CommitsLoggingDebug(commits));
-    updateCommits((List<IndexCommit>) commits);
+    updateCommits(commits);
   }
 
   /**
    * Internal use for Lucene... do not explicitly call.
    */
   @Override
-  public void onCommit(List commits) throws IOException {
+  public void onCommit(List<? extends IndexCommit> commits) throws IOException {
     // SOLR-4547: log basic data at INFO, add filenames at DEBUG.
     log.info("SolrDeletionPolicy.onCommit: commits: {}",
         new CommitsLoggingInfo(commits));
     log.debug("SolrDeletionPolicy.onCommit: commits: {}",
         new CommitsLoggingDebug(commits));
-    updateCommits((List<IndexCommit>) commits);
+    updateCommits(commits);
   }
 
   private static class CommitsLoggingInfo {
-    private List<IndexCommit> commits;
+    private List<? extends IndexCommit> commits;
 
-    public CommitsLoggingInfo(List<IndexCommit> commits) {
+    public CommitsLoggingInfo(List<? extends IndexCommit> commits) {
       this.commits = commits;
     }
 
@@ -135,7 +135,7 @@ public class SolrDeletionPolicy extends 
   }
 
   private static class CommitsLoggingDebug extends CommitsLoggingInfo {
-    public CommitsLoggingDebug(List<IndexCommit> commits) {
+    public CommitsLoggingDebug(List<? extends IndexCommit> commits) {
       super(commits);
     }
 
@@ -150,7 +150,7 @@ public class SolrDeletionPolicy extends 
     }
   }
 
-  private void updateCommits(List<IndexCommit> commits) {
+  private void updateCommits(List<? extends IndexCommit> commits) {
     // to be safe, we should only call delete on a commit point passed to us
     // in this specific call (may be across diff IndexWriter instances).
     // this will happen rarely, so just synchronize everything