Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spotbugs plugin 4.8.2.0 #1538

Merged
merged 4 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@
<!-- Do not run extra reporting for checkstyle or pmd -->
<!-- https://stackoverflow.com/questions/12038238/unable-to-locate-source-xref-to-link-to -->
<linkXRef>false</linkXRef>
<!-- TODO: Remove when plugin pom is using this version or newer -->
<!-- https://github.com/jenkinsci/plugin-pom/pull/869 -->
<spotbugs-maven-plugin.version>4.8.2.0</spotbugs-maven-plugin.version>
<spotbugs.effort>Max</spotbugs.effort>
<!-- TODO: Remove when plugin pom includes this omitVisitors -->
<!-- https://github.com/jenkinsci/plugin-pom/pull/869 -->
<spotbugs.omitVisitors>ConstructorThrow,FindReturnRef</spotbugs.omitVisitors>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/hudson/plugins/git/GitSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,7 @@
@Symbol({"scmGit", "gitSCM"}) // Cannot use "git" because there is already a `git` pipeline step
public static final class DescriptorImpl extends SCMDescriptor<GitSCM> {

@SuppressFBWarnings(value="UUF_UNUSED_FIELD", justification="Do not risk compatibility")
private String gitExe;
private String globalConfigName;
private String globalConfigEmail;
Expand Down Expand Up @@ -1734,7 +1735,7 @@
*/
@Deprecated
public String getGitExe() {
return gitExe;
return null;

Check warning on line 1738 in src/main/java/hudson/plugins/git/GitSCM.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1738 is not covered by tests
}

/**
Expand Down Expand Up @@ -1805,7 +1806,7 @@
* @return git executable
*/
public String getOldGitExe() {
return gitExe;
return null;
}

public static List<RemoteConfig> createRepositoryConfigurations(String[] urls,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/git/RemoteConfigConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.Mapper;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.transport.RemoteConfig;

Expand Down Expand Up @@ -119,6 +120,7 @@ private void fromMap(Map<String, Collection<String>> map) {
}
}

@SuppressFBWarnings(value="SE_PREVENT_EXT_OBJ_OVERWRITE", justification="Used during version upgrade")
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
name = in.readUTF();
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/AssemblaWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;
import java.io.IOException;
import java.net.URI;
Expand Down Expand Up @@ -95,8 +96,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public AssemblaWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(AssemblaWeb.class, jsonObject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -78,8 +79,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public BitbucketServer newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(BitbucketServer.class, jsonObject);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -79,8 +80,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public BitbucketWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(BitbucketWeb.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/CGit.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -89,8 +90,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public CGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(CGit.class, jsonObject);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;
import java.io.IOException;
import java.net.URL;
Expand Down Expand Up @@ -76,8 +77,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public FisheyeGitRepositoryBrowser newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(FisheyeGitRepositoryBrowser.class, jsonObject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;
import java.io.IOException;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -81,8 +82,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GitBlitRepositoryBrowser newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GitBlitRepositoryBrowser.class, jsonObject);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/GitLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.net.URL;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;

import org.kohsuke.stapler.QueryParameter;
Expand Down Expand Up @@ -142,8 +143,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GitLab newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GitLab.class, jsonObject);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/GitList.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -91,8 +92,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GitList newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GitList.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/GitWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -91,8 +92,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GitWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GitWeb.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/GithubWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -97,8 +98,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GithubWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GithubWeb.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/Gitiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.net.URL;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;

import net.sf.json.JSONObject;
Expand Down Expand Up @@ -69,8 +70,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public Gitiles newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(Gitiles.class, jsonObject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -73,8 +74,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GitoriousWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GitoriousWeb.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/GogsGit.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -99,8 +100,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public GogsGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(GogsGit.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/KilnGit.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -110,8 +111,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public KilnGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(KilnGit.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/Phabricator.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -89,8 +90,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public Phabricator newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(Phabricator.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/RedmineWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -92,8 +93,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public RedmineWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(RedmineWeb.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/RhodeCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -94,8 +95,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public RhodeCode newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(RhodeCode.class, jsonObject);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/git/browser/Stash.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.kohsuke.stapler.StaplerRequest;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;

Expand Down Expand Up @@ -94,8 +95,9 @@ public String getDisplayName() {
}

@Override
@SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification = "Inherited javadoc commits that req is non-null")
public Stash newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException {
assert req != null; //see inherited javadoc
return req.bindJSON(Stash.class, jsonObject);
}
}
Expand Down
Loading
Loading