Skip to content

Commit

Permalink
Suppress warnings for spotbugs 4.8.3
Browse files Browse the repository at this point in the history
jenkinsci/plugin-pom#869 or a subsequent pull
request that updates to 4.8.3 will need this change in the plugin to
resolve new spotbugs warnings that will be reported by spotbugs 4.8.2
and later.

Plugin pom 4.77 is likely to include that new version of spotbugs.
  • Loading branch information
MarkEWaite authored and slide committed Jan 16, 2024
1 parent 2e0bf04 commit f848806
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import hudson.model.*;
import java.io.IOException;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro;
import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException;
Expand All @@ -16,12 +17,14 @@ abstract public class AbstractChangesSinceMacro
@Parameter
public boolean reverse = false;
@Parameter
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String format;
@Parameter
public boolean showPaths = false;
@Parameter
public String changesFormat;
@Parameter
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String pathFormat = "\\t%p\\n";
@Parameter
public boolean showDependencies = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jenkinsci.plugins.tokenmacro.impl;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
Expand Down Expand Up @@ -37,8 +38,10 @@ public class ChangesSinceLastBuildMacro extends DataBoundTokenMacro {
@Parameter
public boolean showPaths = false;
@Parameter
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String format;
@Parameter
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String pathFormat = PATH_FORMAT_DEFAULT_VALUE;
@Parameter
public boolean showDependencies = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jenkinsci.plugins.tokenmacro.impl;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import hudson.Extension;
Expand Down Expand Up @@ -40,6 +41,7 @@ public class JsonFileMacro extends DataBoundTokenMacro {
public String file = null;

@Parameter
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String path = null;

@Parameter
Expand Down Expand Up @@ -154,4 +156,4 @@ public String call() throws IOException {
return result;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package org.jenkinsci.plugins.tokenmacro.impl;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
Expand All @@ -49,6 +50,7 @@
@Extension
public class WorkspaceFileMacro extends DataBoundTokenMacro {
@Parameter(required=true)
@SuppressFBWarnings(value="PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification="Retain API compatibility.")
public String path = "";
@Parameter
public String fileNotFoundMessage = "ERROR: File '%s' does not exist";
Expand Down

0 comments on commit f848806

Please sign in to comment.