Skip to content

Commit 6a73f89

Browse files
Use equals() to compare String-s over operators in hasRemoteClusters() (#115154)
1 parent 0a399b5 commit 6a73f89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/SearchResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,8 @@ public boolean hasClusterObjects() {
787787
* This will be false for local-cluster (non-CCS) only searches.
788788
*/
789789
public boolean hasRemoteClusters() {
790-
return total > 1 || clusterInfo.keySet().stream().anyMatch(alias -> alias != RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY);
790+
return total > 1
791+
|| clusterInfo.keySet().stream().anyMatch(alias -> alias.equals(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY) == false);
791792
}
792793

793794
}

0 commit comments

Comments
 (0)