lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [2/3] lucene-solr:branch_6x: SOLR-8995: Replace anonymous implementations of SAM interfaces with Lambdas
Date Fri, 15 Apr 2016 13:41:31 GMT
SOLR-8995: Replace anonymous implementations of SAM interfaces with Lambdas


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/0e30fe1c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0e30fe1c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0e30fe1c

Branch: refs/heads/branch_6x
Commit: 0e30fe1c39f5c56a1e01b7d49d1a0e2e5a6d894e
Parents: f82a27a
Author: Noble Paul <noble@apache.org>
Authored: Fri Apr 15 19:03:22 2016 +0530
Committer: Noble Paul <noble@apache.org>
Committed: Fri Apr 15 19:04:57 2016 +0530

----------------------------------------------------------------------
 .../src/java/org/apache/solr/core/SolrCore.java | 31 +++++++++-----------
 1 file changed, 14 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0e30fe1c/solr/core/src/java/org/apache/solr/core/SolrCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 3e10efe..faac0a2 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -1822,25 +1822,22 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
       final RefCounted<SolrIndexSearcher> currSearcherHolderF = currSearcherHolder;
       if (!alreadyRegistered) {
         future = searcherExecutor.submit(
-            new Callable() {
-              @Override
-              public Object call() throws Exception {
-                try {
-                  // registerSearcher will decrement onDeckSearchers and
-                  // do a notify, even if it fails.
-                  registerSearcher(newSearchHolder);
-                } catch (Throwable e) {
-                  SolrException.log(log, e);
-                  if (e instanceof Error) {
-                    throw (Error) e;
-                  }
-                } finally {
-                  // we are all done with the old searcher we used
-                  // for warming...
-                  if (currSearcherHolderF!=null) currSearcherHolderF.decref();
+            () -> {
+              try {
+                // registerSearcher will decrement onDeckSearchers and
+                // do a notify, even if it fails.
+                registerSearcher(newSearchHolder);
+              } catch (Throwable e) {
+                SolrException.log(log, e);
+                if (e instanceof Error) {
+                  throw (Error) e;
                 }
-                return null;
+              } finally {
+                // we are all done with the old searcher we used
+                // for warming...
+                if (currSearcherHolderF!=null) currSearcherHolderF.decref();
               }
+              return null;
             }
         );
       }


Mime
View raw message