You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2020/08/13 03:48:05 UTC

[lucene-solr] 02/02: SOLR-14680: make jdk 8 compatible

This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 3b3e46a0b4a97946d7ff3c1b54a30a092d302b4e
Author: noblepaul <no...@gmail.com>
AuthorDate: Thu Aug 13 13:47:40 2020 +1000

    SOLR-14680: make jdk 8 compatible
---
 .../src/java/org/apache/solr/cluster/api/SimpleMap.java      |  2 +-
 .../src/java/org/apache/solr/common/LazySolrCluster.java     | 12 ++++++------
 solr/solrj/src/java/org/apache/solr/common/SimpleZkMap.java  |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/cluster/api/SimpleMap.java b/solr/solrj/src/java/org/apache/solr/cluster/api/SimpleMap.java
index 473da05..ca747b9 100644
--- a/solr/solrj/src/java/org/apache/solr/cluster/api/SimpleMap.java
+++ b/solr/solrj/src/java/org/apache/solr/cluster/api/SimpleMap.java
@@ -62,7 +62,7 @@ public interface SimpleMap<T> extends MapWriter {
    * @param fun Consume each entry and return a boolean to signal whether to proceed or not. If true, continue, if false stop
    */
   default void abortableForEach(BiFunction<String, ? super T, Boolean> fun) {
-    forEachEntry(new BiConsumer<>() {
+    forEachEntry(new BiConsumer<String, T>() {
       boolean end = false;
       @Override
       public void accept(String k, T v) {
diff --git a/solr/solrj/src/java/org/apache/solr/common/LazySolrCluster.java b/solr/solrj/src/java/org/apache/solr/common/LazySolrCluster.java
index 1ec5ecf..f339485 100644
--- a/solr/solrj/src/java/org/apache/solr/common/LazySolrCluster.java
+++ b/solr/solrj/src/java/org/apache/solr/common/LazySolrCluster.java
@@ -66,7 +66,7 @@ public class LazySolrCluster implements SolrCluster {
                     return Boolean.FALSE;
                 });
 
-        return new SimpleMap<>() {
+        return new SimpleMap<CollectionConfig>() {
             @Override
             public CollectionConfig get(String key) {
                 if (configNames.contains(key)) {
@@ -91,7 +91,7 @@ public class LazySolrCluster implements SolrCluster {
     }
 
     private SimpleMap<SolrNode> lazyNodeMap() {
-        return new SimpleMap<>() {
+        return new SimpleMap<SolrNode>() {
             @Override
             public SolrNode get(String key) {
                 if (!zkStateReader.getClusterState().liveNodesContain(key)) {
@@ -115,7 +115,7 @@ public class LazySolrCluster implements SolrCluster {
     }
 
     private SimpleMap<SolrCollection> lazyCollectionsWithAlias(ZkStateReader zkStateReader) {
-        return new SimpleMap<>() {
+        return new SimpleMap<SolrCollection>() {
             @Override
             public SolrCollection get(String key) {
                 SolrCollection result = collections.get(key);
@@ -145,7 +145,7 @@ public class LazySolrCluster implements SolrCluster {
     }
 
     private SimpleMap<SolrCollection> lazyCollectionsMap(ZkStateReader zkStateReader) {
-        return new SimpleMap<>() {
+        return new SimpleMap<SolrCollection>() {
             @Override
             public SolrCollection get(String key) {
                 return _collection(key, null);
@@ -338,7 +338,7 @@ public class LazySolrCluster implements SolrCluster {
 
         @Override
         public String name() {
-            return replica.name;
+            return replica.getName();
         }
 
         @Override
@@ -363,7 +363,7 @@ public class LazySolrCluster implements SolrCluster {
 
         @Override
         public Replica.Type type() {
-            return replica.type;
+            return replica.getType();
         }
 
         @Override
diff --git a/solr/solrj/src/java/org/apache/solr/common/SimpleZkMap.java b/solr/solrj/src/java/org/apache/solr/common/SimpleZkMap.java
index 644125f..7d685c2 100644
--- a/solr/solrj/src/java/org/apache/solr/common/SimpleZkMap.java
+++ b/solr/solrj/src/java/org/apache/solr/common/SimpleZkMap.java
@@ -109,7 +109,7 @@ public class SimpleZkMap implements SimpleMap<Resource> {
         try {
             Map<String, List<String>> withKids = new LinkedHashMap<>();
             for (String child : childrenList) {
-                String relativePath =  parent.isBlank() ? child: parent+"/"+child;
+                String relativePath =  parent.isEmpty() ? child: parent+"/"+child;
                 if(!fun.apply(relativePath, readZkNode(relativePath))) return false;
                 List<String> l1 =  zkStateReader.getZkClient().getChildren(basePath+ "/"+ relativePath, null, true);
                 if(l1 != null && !l1.isEmpty()) {