aparnasuresh85 commented on code in PR #2599:
URL: https://github.com/apache/solr/pull/2599#discussion_r1704679393
##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java:
##########
@@ -108,8 +112,7 @@ default DocCollection getCollection(String name) throws
IOException {
/** Obtain a cluster property, or the default value if it doesn't exist. */
default <T> T getClusterProperty(String key, T defaultValue) {
@SuppressWarnings({"unchecked"})
- T value = (T) getClusterProperties().get(key);
- if (value == null) return defaultValue;
+ T value = (T) getClusterProperties().getOrDefault(key, defaultValue);
return value;
Review Comment:
I am unable to remove the declare else the build fails with
Task :solr:solrj:compileJava
/Users/aparna.suresh/blt/upstream/configurable-clusterstatus/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java:114:
warning: [unchecked] unchecked cast
return (T) getClusterProperties().getOrDefault(key, defaultValue);
^
required: T
found: Object
where T is a type-variable:
T extends Object declared in method <T>getClusterProperty(String,T)
error: warnings found and -Werror specified
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
1 warning
##########
solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java:
##########
@@ -34,19 +34,23 @@
import org.apache.solr.common.cloud.PerReplicaStates;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.Slice;
-import org.apache.solr.common.cloud.ZkNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.params.ShardParams;
+import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.common.util.Utils;
import org.apache.zookeeper.KeeperException;
public class ClusterStatus {
private final ZkStateReader zkStateReader;
- private final ZkNodeProps message;
+ private SolrParams solrParams;
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]