Skip to content

Commit

Permalink
Replace JSR-305 annotations with spotbugs annotations (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite authored May 8, 2024
1 parent 8a1ee1c commit 48134f6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.datapipe.jenkins.vault.model.VaultSecret;
import com.google.common.annotations.VisibleForTesting;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.EnvVars;
import hudson.Extension;
import hudson.console.ConsoleLogFilter;
Expand All @@ -43,7 +44,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback.TailCall;
import org.jenkinsci.plugins.workflow.steps.BodyInvoker;
import org.jenkinsci.plugins.workflow.steps.EnvironmentExpander;
Expand Down Expand Up @@ -182,7 +182,7 @@ public String getFunctionName() {
return "withVault";
}

@Nonnull
@NonNull
@Override
public String getDisplayName() {
return "Vault Plugin";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.datapipe.jenkins.vault.credentials.common;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import hudson.FilePath;
Expand All @@ -13,7 +14,6 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor;
import org.jenkinsci.plugins.credentialsbinding.MultiBinding;
import org.jenkinsci.plugins.credentialsbinding.impl.UnbindableDir;
Expand Down Expand Up @@ -46,7 +46,7 @@ protected Class<VaultCertificateCredentials> type() {
}

@Override
public MultiEnvironment bind(@Nonnull Run<?, ?> build, FilePath workspace, Launcher launcher,
public MultiEnvironment bind(@NonNull Run<?, ?> build, FilePath workspace, Launcher launcher,
TaskListener listener)
throws IOException, InterruptedException {
VaultCertificateCredentials credentials = this.getCredentials(build);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.datapipe.jenkins.vault.credentials.common;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.Run;
import hudson.model.TaskListener;
import java.io.IOException;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.jenkinsci.Symbol;
import org.jenkinsci.plugins.credentialsbinding.Binding;
import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor;
Expand All @@ -25,10 +25,10 @@ public VaultStringCredentialBinding(String variable, String credentialsId) {
return VaultStringCredential.class;
}

@Override public SingleEnvironment bindSingle(@Nonnull Run<?,?> build,
@Override public SingleEnvironment bindSingle(@NonNull Run<?,?> build,
@Nullable FilePath workspace,
@Nullable Launcher launcher,
@Nonnull TaskListener listener) throws IOException, InterruptedException {
@NonNull TaskListener listener) throws IOException, InterruptedException {
return new SingleEnvironment(getCredentials(build).getSecret().getPlainText());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.datapipe.jenkins.vault.credentials.common;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import hudson.FilePath;
Expand All @@ -13,7 +14,6 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.jenkinsci.plugins.credentialsbinding.BindingDescriptor;
import org.jenkinsci.plugins.credentialsbinding.MultiBinding;
import org.kohsuke.stapler.AncestorInPath;
Expand Down Expand Up @@ -45,7 +45,7 @@ protected Class<VaultUsernamePasswordCredential> type() {
}

@Override
public MultiEnvironment bind(@Nonnull Run<?, ?> build, FilePath workspace, Launcher launcher,
public MultiEnvironment bind(@NonNull Run<?, ?> build, FilePath workspace, Launcher launcher,
TaskListener listener)
throws IOException, InterruptedException {
VaultUsernamePasswordCredential credentials = this.getCredentials(build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datapipe.jenkins.vault.credentials.VaultAppRoleCredential;
import com.datapipe.jenkins.vault.credentials.VaultCredential;
import com.datapipe.jenkins.vault.model.VaultSecret;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.EnvVars;
import hudson.Extension;
import hudson.model.Run;
Expand All @@ -17,7 +18,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.jenkinsci.plugins.workflow.steps.StepContext;
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.steps.StepExecution;
Expand Down Expand Up @@ -103,7 +103,7 @@ public String getFunctionName() {
return "withVaultMock";
}

@Nonnull
@NonNull
@Override
public String getDisplayName() {
return "Vault Mock Plugin";
Expand Down

0 comments on commit 48134f6

Please sign in to comment.