From ef4bd0e7cc5d6a18e5824463b2e1f47f2efa3e33 Mon Sep 17 00:00:00 2001 From: Anders Payerl Date: Thu, 9 May 2024 23:01:48 +0200 Subject: [PATCH] fix: fix problem with OptionalOrder null from getOptional() --- src/main/java/se/payerl/OptionalOrder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/se/payerl/OptionalOrder.java b/src/main/java/se/payerl/OptionalOrder.java index 3d26025..56086fe 100644 --- a/src/main/java/se/payerl/OptionalOrder.java +++ b/src/main/java/se/payerl/OptionalOrder.java @@ -3,6 +3,7 @@ import org.apache.maven.model.Dependency; import java.util.List; +import java.util.Objects; public class OptionalOrder extends SortOrder { String first; @@ -11,7 +12,7 @@ public class OptionalOrder extends SortOrder { public OptionalOrder() { } private String getOptional(Dependency dep) { - return dep.getOptional().equalsIgnoreCase("true") ? "true" : "false"; + return Boolean.toString(Objects.equals(dep.getOptional(), "true")); } @Override