From 9f37445be8452fc4e949fbb7abe732d75d23aca2 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 25 Mar 2022 15:46:21 +0100 Subject: [PATCH] JAL-3878 Move action name initialization to its own setter. --- src/jalview/ws2/actions/BaseAction.java | 9 +++++++-- src/jalview/ws2/actions/alignment/AlignmentAction.java | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/jalview/ws2/actions/BaseAction.java b/src/jalview/ws2/actions/BaseAction.java index 0fc7aa0..97cf6fa 100644 --- a/src/jalview/ws2/actions/BaseAction.java +++ b/src/jalview/ws2/actions/BaseAction.java @@ -39,9 +39,13 @@ public abstract class BaseAction implements ActionI protected EnumSet requiredCredentials = EnumSet.noneOf(CredentialType.class); - public Builder(String name) + public Builder() { - this.name = name; + } + + public void name(String val) + { + this.name = val; } public void webService(WebService val) @@ -112,6 +116,7 @@ public abstract class BaseAction implements ActionI { Objects.requireNonNull(builder.webService); this.webService = builder.webService; + Objects.requireNonNull(builder.name); this.name = builder.name; this.tooltip = builder.tooltip; this.subcategory = builder.subcategory; diff --git a/src/jalview/ws2/actions/alignment/AlignmentAction.java b/src/jalview/ws2/actions/alignment/AlignmentAction.java index 040e6ef..7f935bf 100644 --- a/src/jalview/ws2/actions/alignment/AlignmentAction.java +++ b/src/jalview/ws2/actions/alignment/AlignmentAction.java @@ -33,9 +33,9 @@ public class AlignmentAction extends BaseAction protected boolean submitGaps = false; - public Builder(AlignmentWebServiceClientI client, String name) + public Builder(AlignmentWebServiceClientI client) { - super(name); + super(); Objects.requireNonNull(client); this.client = client; } @@ -51,9 +51,9 @@ public class AlignmentAction extends BaseAction } } - public static Builder newBuilder(AlignmentWebServiceClientI client, String name) + public static Builder newBuilder(AlignmentWebServiceClientI client) { - return new Builder(client, name); + return new Builder(client); } protected final boolean submitGaps; -- 1.7.10.2