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);