Skip to content

Commit

Permalink
Merge pull request #1856 from hub4j/dependabot/maven/spotbugs.version…
Browse files Browse the repository at this point in the history
…-4.8.6

Chore(deps): Bump spotbugs.version from 4.7.3 to 4.8.6
  • Loading branch information
bitwiseman committed Jun 20, 2024
2 parents 379996d + 499f047 commit a1acabd
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotbugs-maven-plugin.version>4.8.1.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.7.3</spotbugs.version>
<spotbugs-maven-plugin.version>4.8.5.0</spotbugs-maven-plugin.version>
<spotbugs.version>4.8.6</spotbugs.version>
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
<hamcrest.version>2.2</hamcrest.version>
<okhttp3.version>4.9.2</okhttp3.version>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/kohsuke/github/AbstractBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.IOException;

import javax.annotation.CheckForNull;
Expand Down Expand Up @@ -75,6 +77,7 @@ abstract class AbstractBuilder<R, S> extends GitHubInteractiveObject {
* @param baseInstance
* optional instance on which to base this builder.
*/
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "argument validation, internal class")
protected AbstractBuilder(@Nonnull Class<R> finalReturnType,
@Nonnull Class<S> intermediateReturnType,
@Nonnull GitHub root,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHArtifactsPage.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of artifacts result when listing artifacts.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHArtifactsPage {
private int total_count;
private GHArtifact[] artifacts;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHCheckRunsPage.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of check-runs result when listing check-runs.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHCheckRunsPage {
private int total_count;
private GHCheckRun[] check_runs;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHCommitSearchBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.internal.Previews;

Expand Down Expand Up @@ -249,6 +250,9 @@ public enum Sort {
COMMITTER_DATE
}

@SuppressFBWarnings(
value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
private static class CommitSearchResult extends SearchResult<GHCommit> {
private GHCommit[] items;

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/kohsuke/github/GHIssueSearchBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Search issues.
Expand Down Expand Up @@ -117,6 +119,9 @@ public enum Sort {
UPDATED
}

@SuppressFBWarnings(
value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
private static class IssueSearchResult extends SearchResult<GHIssue> {
private GHIssue[] items;

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/kohsuke/github/GHMembership.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @author Kohsuke Kawaguchi
* @see GHMyself#listOrgMemberships() GHMyself#listOrgMemberships()
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
public class GHMembership extends GitHubInteractiveObject {

/** The url. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Search repositories.
Expand Down Expand Up @@ -328,6 +330,9 @@ public String toString() {
}
}

@SuppressFBWarnings(
value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
private static class RepositorySearchResult extends SearchResult<GHRepository> {
private GHRepository[] items;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHTree.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -14,6 +16,8 @@
* @see GHRepository#getTree(String) GHRepository#getTree(String)
* @see GHTreeEntry#asTree() GHTreeEntry#asTree()
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
public class GHTree {

/** The repo. */
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHWorkflowJobsPage.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of jobs result when listing jobs from a workflow run.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHWorkflowJobsPage {
private int total_count;
private GHWorkflowJob[] jobs;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHWorkflowRunsPage.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of workflow runs result when listing workflow runs.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHWorkflowRunsPage {
private int totalCount;
private GHWorkflowRun[] workflowRuns;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/kohsuke/github/GHWorkflowsPage.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the one page of workflow result when listing workflows.
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHWorkflowsPage {
private int total_count;
private GHWorkflow[] workflows;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/kohsuke/github/GitHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public class GitHub {
* @throws IOException
* Signals that an I/O exception has occurred.
*/
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "internal constructor")
GitHub(String apiUrl,
GitHubConnector connector,
GitHubRateLimitHandler rateLimitHandler,
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/kohsuke/github/GitHubPageIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ class GitHubPageIterator<T> implements Iterator<T> {
private GitHubResponse<T> finalResponse = null;

private GitHubPageIterator(GitHubClient client, Class<T> type, GitHubRequest request) {
if (!"GET".equals(request.method())) {
throw new IllegalStateException("Request method \"GET\" is required for page iterator.");
}

this.client = client;
this.type = type;
this.nextRequest = request;
Expand Down Expand Up @@ -83,6 +79,10 @@ static <T> GitHubPageIterator<T> create(GitHubClient client, Class<T> type, GitH
request = builder.build();
}

if (!"GET".equals(request.method())) {
throw new IllegalArgumentException("Request method \"GET\" is required for page iterator.");
}

return new GitHubPageIterator<>(client, type, request);
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/kohsuke/github/GitHubRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class GitHubRequest implements GitHubConnectorRequest {

private final URL url;

@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "Basic argument validation")
private GitHubRequest(@Nonnull List<Entry> args,
@Nonnull Map<String, List<String>> headers,
@Nonnull Map<String, Object> injectedMappingValues,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/kohsuke/github/RateLimitChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public static class LiteralValue extends RateLimitChecker {
*/
public LiteralValue(int sleepAtOrBelow) {
if (sleepAtOrBelow < 0) {
throw new IllegalArgumentException("sleepAtOrBelow must >= 0");
// ignore negative numbers
sleepAtOrBelow = 0;
}
this.sleepAtOrBelow = sleepAtOrBelow;
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/kohsuke/github/SearchResult.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.kohsuke.github;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

// TODO: Auto-generated Javadoc
/**
* Represents the result of a search.
Expand All @@ -13,11 +11,9 @@
abstract class SearchResult<T> {

/** The total count. */
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "Field comes from JSON deserialization")
int total_count;

/** The incomplete results. */
@SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "Field comes from JSON deserialization")
boolean incomplete_results;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.kohsuke.github.extras;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.connector.GitHubConnector;
import org.kohsuke.github.connector.GitHubConnectorRequest;
import org.kohsuke.github.connector.GitHubConnectorResponse;
Expand All @@ -11,6 +12,7 @@
*
* @author Liam Newman
*/
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "Basic validation")
public class HttpClientGitHubConnector implements GitHubConnector {

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/kohsuke/github/extras/OkHttpConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.squareup.okhttp.ConnectionSpec;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.OkUrlFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.HttpConnector;
import org.kohsuke.github.extras.okhttp3.OkHttpGitHubConnector;

Expand Down Expand Up @@ -31,6 +32,7 @@
* @see OkHttpGitHubConnector
*/
@Deprecated
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "Deprecated")
public class OkHttpConnector implements HttpConnector {
private static final String HEADER_NAME = "Cache-Control";
private final OkUrlFactory urlFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.kohsuke.github.extras.authorization;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.kohsuke.github.authorization.AuthorizationProvider;

import java.io.File;
Expand All @@ -23,6 +24,7 @@
* authenticate as an application. This token provider does not provide any kind of caching, and will always request a
* new token to the API.
*/
@SuppressFBWarnings(value = { "CT_CONSTRUCTOR_THROW" }, justification = "TODO")
public class JWTTokenProvider implements AuthorizationProvider {

private final PrivateKey privateKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ interface IJwtBuilder {
* Without this class, JwtBuilderUtil.buildJwt() immediately throws NoClassDefFoundError when called. With this
* class the error is thrown when DefaultBuilder.build() is called allowing us to catch and handle it.
*/
private static class DefaultBuilderImpl implements IJwtBuilder {
private static final class DefaultBuilderImpl implements IJwtBuilder {
/**
* This method builds a JWT using 0.12.x or later versions of jjwt library
*
Expand Down Expand Up @@ -135,7 +135,7 @@ public String buildJwt(Instant issuedAt, Instant expiration, String applicationI
/**
* A class to encapsulate building a JWT using reflection.
*/
private static class ReflectionBuilderImpl implements IJwtBuilder {
private static final class ReflectionBuilderImpl implements IJwtBuilder {

private Method setIssuedAtMethod;
private Method setExpirationMethod;
Expand Down

0 comments on commit a1acabd

Please sign in to comment.