Skip to content

Commit

Permalink
Use String utility
Browse files Browse the repository at this point in the history
Signed-off-by: Rishab Nahata <rnnahata@amazon.com>
  • Loading branch information
imRishN committed Sep 29, 2022
1 parent fc6dd88 commit 14f4ce0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
import org.opensearch.cluster.decommission.DecommissionAttribute;
import org.opensearch.common.Strings;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;

Expand Down Expand Up @@ -67,10 +68,10 @@ public DecommissionAttribute getDecommissionAttribute() {
@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (decommissionAttribute.attributeName() == null || decommissionAttribute.attributeName().isEmpty()) {
if (decommissionAttribute.attributeName() == null || Strings.isEmpty(decommissionAttribute.attributeName())) {
validationException = addValidationError("attribute name is missing", validationException);
}
if (decommissionAttribute.attributeValue() == null || decommissionAttribute.attributeValue().isEmpty()) {
if (decommissionAttribute.attributeValue() == null || Strings.isEmpty(decommissionAttribute.attributeValue())) {
validationException = addValidationError("attribute value is missing", validationException);
}
return validationException;
Expand Down

0 comments on commit 14f4ce0

Please sign in to comment.