Skip to content

Commit

Permalink
Suppress warnings for spotbugs 4.8.3 (#611)
Browse files Browse the repository at this point in the history
Plugin pom 4.77 needs this change to resolve new spotbugs warnings
that will be reported by spotbugs 4.8.3 and later.

Confirmed that the spotbugs warnings are visible when using the
4.77-SNAPSHOT plugin pom before this change. With this change, the
spotbugs warnings are no longer visible.
  • Loading branch information
MarkEWaite authored Jan 16, 2024
1 parent 2b993f4 commit 47aff0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.AutoCompletionCandidates;
import hudson.model.Item;
Expand Down Expand Up @@ -32,24 +33,32 @@ public class LockStep extends Step implements Serializable {
private static final long serialVersionUID = -953609907239674360L;

@CheckForNull
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public String resource = null;

@CheckForNull
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public String label = null;

@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public int quantity = 0;

/** name of environment variable to store locked resources in */
@CheckForNull
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public String variable = null;

@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public boolean inversePrecedence = false;

@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public String resourceSelectStrategy = ResourceSelectStrategy.SEQUENTIAL.name();

@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public boolean skipIfLocked = false;

@CheckForNull
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public List<LockStepResource> extra = null;

// it should be LockStep() - without params. But keeping this for backward compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.Util;
import hudson.model.AbstractDescribableImpl;
Expand All @@ -28,8 +29,10 @@ public class LockStepResource extends AbstractDescribableImpl<LockStepResource>
public String resource = null;

@CheckForNull
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public String label = null;

@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve API compatibility.")
public int quantity = 0;

LockStepResource(@Nullable String resource, @Nullable String label, int quantity) {
Expand Down

0 comments on commit 47aff0d

Please sign in to comment.