Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/hudson/plugins/repo/RepoScm.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import hudson.scm.SCMRevisionState;
import net.sf.json.JSONObject;

import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
Expand All @@ -76,6 +75,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Objects;

/**
* The main entrypoint of the plugin. This class contains code to store user
Expand Down Expand Up @@ -287,7 +287,7 @@
*/
@Exported
public String getIgnoreProjects() {
return StringUtils.join(ignoreProjects, '\n');
return ignoreProjects == null ? null : String.join("\n", ignoreProjects);

Check warning on line 290 in src/main/java/hudson/plugins/repo/RepoScm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 290 is only partially covered, one branch is missing
}

/**
Expand Down Expand Up @@ -995,7 +995,7 @@
}

private void abortIfUrlLocal() throws AbortException {
if (StringUtils.isNotEmpty(manifestRepositoryUrl)
if (Util.fixEmpty(manifestRepositoryUrl) != null

Check warning on line 998 in src/main/java/hudson/plugins/repo/RepoScm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 998 is only partially covered, one branch is missing
&& (manifestRepositoryUrl.toLowerCase(Locale.ENGLISH).startsWith("file://")
|| Files.exists(Paths.get(manifestRepositoryUrl)))) {
throw new AbortException("Checkout of Repo url '" + manifestRepositoryUrl
Expand Down Expand Up @@ -1295,9 +1295,9 @@

private boolean isRelevantState(final RevisionState state, final String url,
final String branch, final String file) {
return StringUtils.equals(state.getBranch(), branch)
&& StringUtils.equals(state.getUrl(), url)
&& StringUtils.equals(state.getFile(), file);
return Objects.equals(state.getBranch(), branch)
&& Objects.equals(state.getUrl(), url)
&& Objects.equals(state.getFile(), file);

Check warning on line 1300 in src/main/java/hudson/plugins/repo/RepoScm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 1298-1300 are not covered by tests
}

@Nonnull
Expand Down
Loading