Skip to content

Commit

Permalink
Merge pull request jenkinsci#5774 from StefanSpieker/spotbugs_ms_final
Browse files Browse the repository at this point in the history
Suppress some Spotbugs `MS_SHOULD_BE_FINAL`
  • Loading branch information
oleg-nenashev authored Oct 5, 2021
2 parents d56d2a7 + dbe92c5 commit 4bef1d7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -712,5 +712,6 @@ protected URL findResource(String name) {
}
}

@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static /* not final */ boolean useAntClassLoader = SystemProperties.getBoolean(ClassicPluginStrategy.class.getName() + ".useAntClassLoader", true);
}
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/model/DownloadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionListListener;
Expand Down Expand Up @@ -487,11 +488,13 @@ public static Downloadable get(String id) {
}

// TODO this was previously referenced in the browser-based download, but should probably be checked for the server-based download
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean neverUpdate = SystemProperties.getBoolean(DownloadService.class.getName()+".never");

/**
* May be used to temporarily disable signature checking on {@link DownloadService} and {@link UpdateCenter}.
* Useful when upstream signatures are broken, such as due to expired certificates.
*/
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean signatureCheck = !SystemProperties.getBoolean(DownloadService.class.getName()+".noSignatureCheck");
}
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/model/WorkspaceCleanupThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package hudson.model;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.FilePath;
Expand Down Expand Up @@ -151,6 +152,7 @@ private boolean shouldBeDeleted(@NonNull TopLevelItem item, FilePath dir, @NonNu
/**
* Can be used to disable workspace clean up.
*/
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean disabled = SystemProperties.getBoolean(WorkspaceCleanupThread.class.getName()+".disabled");

/**
Expand All @@ -161,5 +163,6 @@ private boolean shouldBeDeleted(@NonNull TopLevelItem item, FilePath dir, @NonNu
/**
* Number of days workspaces should be retained.
*/
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static int retainForDays = SystemProperties.getInteger(WorkspaceCleanupThread.class.getName()+".retainForDays", 30);
}
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/slaves/CloudRetentionStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.logging.Level.WARNING;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -75,5 +76,6 @@ public void start(AbstractCloudComputer c) {

private static final Logger LOGGER = Logger.getLogger(CloudRetentionStrategy.class.getName());

@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean disabled = SystemProperties.getBoolean(CloudRetentionStrategy.class.getName()+".disabled");
}
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/tasks/Fingerprinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package hudson.tasks;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.EnvVars;
import hudson.Extension;
import hudson.FilePath;
Expand Down Expand Up @@ -82,6 +83,8 @@
* @author Kohsuke Kawaguchi
*/
public class Fingerprinter extends Recorder implements Serializable, DependencyDeclarer, SimpleBuildStep {

@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean enableFingerprintsInDependencyGraph = SystemProperties.getBoolean(Fingerprinter.class.getName() + ".enableFingerprintsInDependencyGraph");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import jenkins.util.SystemProperties;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand All @@ -19,6 +21,8 @@ public class SuspiciousRequestFilter implements Filter {

/** System property name set to true or false to indicate whether or not semicolons should be allowed in URL paths. */
public static final String ALLOW_SEMICOLONS_IN_PATH = SuspiciousRequestFilter.class.getName() + ".allowSemicolonsInPath";

@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean allowSemicolonsInPath = SystemProperties.getBoolean(ALLOW_SEMICOLONS_IN_PATH, false);
private static final Logger LOGGER = Logger.getLogger(SuspiciousRequestFilter.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.Functions;
import hudson.TcpSlaveAgentListener.ConnectionFromCurrentPeer;
Expand Down Expand Up @@ -51,6 +52,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
* @since 2.28
*/
@Restricted(NoExternalUse.class)
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean disableStrictVerification =
SystemProperties.getBoolean(DefaultJnlpSlaveReceiver.class.getName() + ".disableStrictVerification");

Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/jenkins/slaves/StandardOutputSwapper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package jenkins.slaves;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.FilePath;
import hudson.model.Computer;
Expand Down Expand Up @@ -83,5 +84,6 @@ private void swap(StandardOutputStream stdout) throws IOException, NoSuchMethodE
}

private static final Logger LOGGER = Logger.getLogger(StandardOutputSwapper.class.getName());
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Accessible via System Groovy Scripts")
public static boolean disabled = SystemProperties.getBoolean(StandardOutputSwapper.class.getName()+".disabled");
}

0 comments on commit 4bef1d7

Please sign in to comment.