From 629bbb11a5ab4c182127883019137630576f17ae Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sat, 1 Jun 2024 20:14:54 -0600 Subject: [PATCH] Use consistent style and indentation in new code 4 space indentation is used in the rest of the file, let's continue using it in this case. Clarify what is changing by reducing the diffs to the master branch. --- .../core/StringsMatchCondition.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/jenkins_ci/plugins/run_condition/core/StringsMatchCondition.java b/src/main/java/org/jenkins_ci/plugins/run_condition/core/StringsMatchCondition.java index 2bd4d20..654034b 100644 --- a/src/main/java/org/jenkins_ci/plugins/run_condition/core/StringsMatchCondition.java +++ b/src/main/java/org/jenkins_ci/plugins/run_condition/core/StringsMatchCondition.java @@ -51,9 +51,8 @@ public StringsMatchCondition(final String arg1, final String arg2, final boolean } @DataBoundSetter - public void setEnvironmentVariables(Boolean enviornmentVariables){ - - this.environmentVariables=enviornmentVariables; + public void setEnvironmentVariables(Boolean environmentVariables){ + this.environmentVariables=environmentVariables; } public boolean isEnvironmentVariables() { @@ -74,21 +73,15 @@ public boolean isIgnoreCase() { @Override public boolean runPerform(final AbstractBuild build, final BuildListener listener) throws Exception { - - if(environmentVariables == true){ - - final String expanded1 = TokenMacro.expandAll(build, listener, "$"+"{"+arg1+"}"); - final String expanded2 = TokenMacro.expandAll(build, listener, "$"+"{"+arg2+"}"); - - listener.getLogger().println(Messages.stringsMatchCondition_console_args(expanded1, expanded2)); - if (expanded1 == null) return false; - return ignoreCase ? expanded1.equalsIgnoreCase(expanded2) : expanded1.equals(expanded2); - } - else { + if (environmentVariables == true) { + final String expanded1 = TokenMacro.expandAll(build, listener, "$"+"{"+arg1+"}"); + final String expanded2 = TokenMacro.expandAll(build, listener, "$"+"{"+arg2+"}"); + listener.getLogger().println(Messages.stringsMatchCondition_console_args(expanded1, expanded2)); + if (expanded1 == null) return false; + return ignoreCase ? expanded1.equalsIgnoreCase(expanded2) : expanded1.equals(expanded2); + } else { final String expanded1 = TokenMacro.expandAll(build, listener, arg1); final String expanded2 = TokenMacro.expandAll(build, listener, arg2); - - listener.getLogger().println(Messages.stringsMatchCondition_console_args(expanded1, expanded2)); if (expanded1 == null) return false; return ignoreCase ? expanded1.equalsIgnoreCase(expanded2) : expanded1.equals(expanded2);