Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Suppress more spotbugs warnings
Java 11 specific, but not worth the distraction of spotbugs reporting
spurious warnings.  Easier to suppress the warnings than remember that
they can be ignored.
  • Loading branch information
MarkEWaite committed Mar 17, 2019
1 parent 04104cf commit 6cdc97e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
Expand Up @@ -1466,6 +1466,11 @@ public boolean isApplicable(java.lang.Class<? extends Item> job) {
*
* @since 3.6.1
*/
@SuppressFBWarnings(value = { "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE",
"RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
"NP_LOAD_OF_KNOWN_NULL_VALUE"
},
justification = "Java 11 generated code causes redundant nullcheck")
private static class TreeWalkingSCMProbe extends SCMProbe {
private final String name;
private final long lastModified;
Expand Down Expand Up @@ -1508,10 +1513,6 @@ public long lastModified() {
*/
@Override
@NonNull
@SuppressFBWarnings(value = "NP_LOAD_OF_KNOWN_NULL_VALUE",
justification =
"TreeWalk.forPath can return null, compiler "
+ "generated code for try with resources handles it")
public SCMProbeStat stat(@NonNull String path) throws IOException {
try (TreeWalk tw = TreeWalk.forPath(repository, path, tree)) {
if (tw == null) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jenkins/plugins/git/GitSCMFile.java
Expand Up @@ -26,6 +26,7 @@
package jenkins.plugins.git;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
Expand All @@ -48,6 +49,11 @@
*
* @since 3.0.2
*/
@SuppressFBWarnings(value = { "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
"RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE",
"NP_LOAD_OF_KNOWN_NULL_VALUE"
},
justification = "Java 11 generated code causes redundant nullcheck")
public class GitSCMFile extends SCMFile {

private final GitSCMFileSystem fs;
Expand Down

0 comments on commit 6cdc97e

Please sign in to comment.