diff --git a/server/src/main/java/org/opensearch/cluster/decommission/DecommissionService.java b/server/src/main/java/org/opensearch/cluster/decommission/DecommissionService.java index 58c2d0bbc5cd9..e6639ae058066 100644 --- a/server/src/main/java/org/opensearch/cluster/decommission/DecommissionService.java +++ b/server/src/main/java/org/opensearch/cluster/decommission/DecommissionService.java @@ -433,7 +433,7 @@ private static void ensureToBeDecommissionedAttributeWeighedAway(ClusterState st ); } Double attributeValueWeight = weightedRouting.weights().get(decommissionAttribute.attributeValue()); - if (attributeValueWeight == null || attributeValueWeight.equals(0.0)) { + if (attributeValueWeight == null || attributeValueWeight.equals(0.0) == false) { throw new DecommissioningFailedException( decommissionAttribute, "weight for decommissioned attribute is expected to be [0.0] but found [" + attributeValueWeight + "]"