Skip to content

Commit

Permalink
Use consistent style and indentation in new code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MarkEWaite committed Jun 2, 2024
1 parent c448c6c commit 629bbb1
Showing 1 changed file with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);

Check warning on line 81 in src/main/java/org/jenkins_ci/plugins/run_condition/core/StringsMatchCondition.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 55-81 are not covered by tests
} 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);
Expand Down

0 comments on commit 629bbb1

Please sign in to comment.