You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2019/06/16 01:48:29 UTC
[accumulo] branch 2.0 updated: Update spotbugs filters to
accomodate Java 11 (#1214)
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.0 by this push:
new 2d9f12e Update spotbugs filters to accomodate Java 11 (#1214)
2d9f12e is described below
commit 2d9f12ee873c1007438df25a095a4ca3a62b7967
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Sat Jun 15 21:48:24 2019 -0400
Update spotbugs filters to accomodate Java 11 (#1214)
Update filters to suppress triaged warnings from spotbugs findsecbugs
when building with Java 11
---
core/src/main/spotbugs/exclude-filter.xml | 5 +++++
.../accumulo/core/conf/CredentialProviderFactoryShimTest.java | 2 +-
.../apache/accumulo/core/file/BloomFilterLayerLookupTest.java | 3 +--
.../apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java | 1 +
.../org/apache/accumulo/core/file/rfile/RFileMetricsTest.java | 3 +++
.../test/java/org/apache/accumulo/core/file/rfile/RFileTest.java | 3 +++
.../src/main/spotbugs/exclude-filter.xml | 5 +++--
.../accumulo/hadoop/its/mapred/AccumuloFileOutputFormatIT.java | 3 +++
.../java/org/apache/accumulo/hadoop/its/mapred/TokenFileIT.java | 1 +
.../hadoop/its/mapreduce/AccumuloFileOutputFormatIT.java | 3 +++
.../org/apache/accumulo/hadoop/its/mapreduce/TokenFileIT.java | 1 +
.../apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java | 2 +-
.../tracer => minicluster}/src/main/spotbugs/exclude-filter.xml | 5 +++--
.../minicluster/MiniAccumuloClusterExistingZooKeepersTest.java | 2 +-
.../accumulo/minicluster/MiniAccumuloClusterStartStopTest.java | 2 +-
.../org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java | 3 +++
.../apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java | 3 +++
.../accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java | 3 +++
.../accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java | 3 +++
pom.xml | 9 +++++++++
server/{tracer => base}/src/main/spotbugs/exclude-filter.xml | 5 +++--
.../java/org/apache/accumulo/server/ServerConstantsTest.java | 3 +++
.../test/java/org/apache/accumulo/server/fs/VolumeUtilTest.java | 3 +++
.../test/java/org/apache/accumulo/server/util/FileUtilTest.java | 3 +++
server/{tracer => master}/src/main/spotbugs/exclude-filter.xml | 5 +++--
server/tracer/src/main/spotbugs/exclude-filter.xml | 5 +++++
server/{tracer => tserver}/src/main/spotbugs/exclude-filter.xml | 5 +++--
.../test/java/org/apache/accumulo/tserver/InMemoryMapTest.java | 3 +++
.../org/apache/accumulo/tserver/log/RecoveryLogsReaderTest.java | 3 +++
.../org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java | 3 +++
.../apache/accumulo/tserver/log/TestUpgradePathForWALogs.java | 3 +--
.../java/org/apache/accumulo/tserver/tablet/RootFilesTest.java | 3 +++
shell/src/main/java/org/apache/accumulo/shell/Shell.java | 2 ++
.../src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java | 2 ++
shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java | 3 +++
.../classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java | 3 +++
.../start/classloader/vfs/AccumuloVFSClassLoaderTest.java | 3 +++
.../accumulo/start/classloader/vfs/ContextManagerTest.java | 3 +++
.../java/org/apache/accumulo/start/test/AccumuloDFSBase.java | 3 +++
.../accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java | 1 +
.../org/apache/accumulo/test/functional/HalfDeadTServerIT.java | 2 ++
test/src/main/spotbugs/exclude-filter.xml | 9 +++++++++
42 files changed, 119 insertions(+), 18 deletions(-)
diff --git a/core/src/main/spotbugs/exclude-filter.xml b/core/src/main/spotbugs/exclude-filter.xml
index 24bc17a..72639e9 100644
--- a/core/src/main/spotbugs/exclude-filter.xml
+++ b/core/src/main/spotbugs/exclude-filter.xml
@@ -32,4 +32,9 @@
<Package name="org.apache.accumulo.core.trace.thrift" />
</Or>
</Match>
+ <Match>
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
+ </Match>
</FindBugsFilter>
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
index 7fbca8c..b230f3e 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
@@ -42,6 +42,7 @@ import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class CredentialProviderFactoryShimTest {
private static final Configuration hadoopConf = new Configuration();
@@ -52,7 +53,6 @@ public class CredentialProviderFactoryShimTest {
emptyKeyStoreName = "/empty.jceks";
private static File emptyKeyStore, populatedKeyStore;
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
@BeforeClass
public static void checkCredentialProviderAvailable() {
try {
diff --git a/core/src/test/java/org/apache/accumulo/core/file/BloomFilterLayerLookupTest.java b/core/src/test/java/org/apache/accumulo/core/file/BloomFilterLayerLookupTest.java
index 2a52421..b81ff18 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/BloomFilterLayerLookupTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/BloomFilterLayerLookupTest.java
@@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class BloomFilterLayerLookupTest {
private static final Logger log = LoggerFactory.getLogger(BloomFilterLayerLookupTest.class);
@@ -60,8 +61,6 @@ public class BloomFilterLayerLookupTest {
public TemporaryFolder tempDir =
new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
- justification = "tempDir is not provided by user")
@Test
public void test() throws IOException {
HashSet<Integer> valsSet = new HashSet<>();
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
index a9d6fe5..c35e0d2 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java
@@ -69,6 +69,7 @@ import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MultiThreadedRFileTest {
private static final Logger LOG = LoggerFactory.getLogger(MultiThreadedRFileTest.class);
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileMetricsTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileMetricsTest.java
index 7d5f379..ac36add 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileMetricsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileMetricsTest.java
@@ -40,6 +40,9 @@ import org.junit.rules.TemporaryFolder;
import com.google.common.util.concurrent.AtomicLongMap;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class RFileMetricsTest {
@Rule
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
index d098f43..0c33bfe 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
@@ -99,6 +99,9 @@ import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
import com.google.common.primitives.Bytes;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class RFileTest {
public static class SampleIE implements IteratorEnvironment {
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/hadoop-mapreduce/src/main/spotbugs/exclude-filter.xml
similarity index 82%
copy from server/tracer/src/main/spotbugs/exclude-filter.xml
copy to hadoop-mapreduce/src/main/spotbugs/exclude-filter.xml
index ce11cf3..5626c2d 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/hadoop-mapreduce/src/main/spotbugs/exclude-filter.xml
@@ -20,7 +20,8 @@
can be excluded inline by adding the @SuppressFBWarnings annotation.
-->
<Match>
- <!-- ignore thrift-generated classes -->
- <Package name="org.apache.accumulo.tracer.thrift" />
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloFileOutputFormatIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloFileOutputFormatIT.java
index a529cf5..4a5c0f3 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloFileOutputFormatIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/AccumuloFileOutputFormatIT.java
@@ -62,6 +62,9 @@ import org.junit.rules.TemporaryFolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not from user input")
public class AccumuloFileOutputFormatIT extends AccumuloClusterHarness {
private static final Logger log = LoggerFactory.getLogger(AccumuloFileOutputFormatIT.class);
private static final int JOB_VISIBILITY_CACHE_SIZE = 3000;
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/TokenFileIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/TokenFileIT.java
index a3c9f52..65ab8aa 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/TokenFileIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapred/TokenFileIT.java
@@ -57,6 +57,7 @@ import org.junit.rules.TemporaryFolder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not from user input")
public class TokenFileIT extends AccumuloClusterHarness {
private static AssertionError e1 = null;
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/AccumuloFileOutputFormatIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/AccumuloFileOutputFormatIT.java
index de3ebd1..86f81e7 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/AccumuloFileOutputFormatIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/AccumuloFileOutputFormatIT.java
@@ -57,6 +57,9 @@ import org.junit.rules.TemporaryFolder;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not from user input")
public class AccumuloFileOutputFormatIT extends AccumuloClusterHarness {
private String PREFIX;
diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/TokenFileIT.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/TokenFileIT.java
index d8c7bf6..5479018 100644
--- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/TokenFileIT.java
+++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/its/mapreduce/TokenFileIT.java
@@ -54,6 +54,7 @@ import org.junit.rules.TemporaryFolder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not from user input")
public class TokenFileIT extends AccumuloClusterHarness {
private static AssertionError e1 = null;
diff --git a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
index 8291f38..e968564 100644
--- a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@ -196,7 +196,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
}
}
- @SuppressFBWarnings(value = "COMMAND_INJECTION",
+ @SuppressFBWarnings(value = {"COMMAND_INJECTION", "PATH_TRAVERSAL_IN"},
justification = "mini runs in the same security context as user providing the args")
private ProcessInfo _exec(Class<?> clazz, List<String> extraJvmOpts, String... args)
throws IOException {
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/minicluster/src/main/spotbugs/exclude-filter.xml
similarity index 82%
copy from server/tracer/src/main/spotbugs/exclude-filter.xml
copy to minicluster/src/main/spotbugs/exclude-filter.xml
index ce11cf3..5626c2d 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/minicluster/src/main/spotbugs/exclude-filter.xml
@@ -20,7 +20,8 @@
can be excluded inline by adding the @SuppressFBWarnings annotation.
-->
<Match>
- <!-- ignore thrift-generated classes -->
- <Package name="org.apache.accumulo.tracer.thrift" />
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
index fe4fc24..4c5c446 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java
@@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MiniAccumuloClusterExistingZooKeepersTest {
private static final File BASE_DIR = new File(System.getProperty("user.dir")
+ "/target/mini-tests/" + MiniAccumuloClusterExistingZooKeepersTest.class.getName());
@@ -53,7 +54,6 @@ public class MiniAccumuloClusterExistingZooKeepersTest {
@Rule
public TestName testName = new TestName();
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intput determined by test")
@Before
public void setupTestCluster() throws Exception {
assertTrue(BASE_DIR.mkdirs() || BASE_DIR.isDirectory());
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
index f49ab32..482d36b 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterStartStopTest.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MiniAccumuloClusterStartStopTest {
private static final Logger log = LoggerFactory.getLogger(MiniAccumuloClusterStartStopTest.class);
@@ -42,7 +43,6 @@ public class MiniAccumuloClusterStartStopTest {
@Rule
public TestName testName = new TestName();
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "input determined by test")
@Before
public void setupTestCluster() throws IOException {
assertTrue(baseDir.mkdirs() || baseDir.isDirectory());
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
index a6ffabd..2ec9a40 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
@@ -56,6 +56,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MiniAccumuloClusterTest {
public static File testDir;
diff --git a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java
index 75c9019..113e026 100644
--- a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/CleanShutdownMacTest.java
@@ -27,6 +27,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class CleanShutdownMacTest {
@Rule
diff --git a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java
index b672dea..14a92c0 100644
--- a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java
@@ -44,6 +44,9 @@ import org.junit.Test;
import com.google.common.collect.Iterators;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MiniAccumuloClusterImplTest {
public static File testDir;
diff --git a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java
index 9488c41..4db3764 100644
--- a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java
@@ -32,6 +32,9 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class MiniAccumuloConfigImplTest {
@SuppressWarnings("deprecation")
diff --git a/pom.xml b/pom.xml
index a592801..e8ada85 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1626,5 +1626,14 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>jdk-release-flag</id>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ <properties>
+ <maven.compiler.release>8</maven.compiler.release>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/server/base/src/main/spotbugs/exclude-filter.xml
similarity index 82%
copy from server/tracer/src/main/spotbugs/exclude-filter.xml
copy to server/base/src/main/spotbugs/exclude-filter.xml
index ce11cf3..5626c2d 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/server/base/src/main/spotbugs/exclude-filter.xml
@@ -20,7 +20,8 @@
can be excluded inline by adding the @SuppressFBWarnings annotation.
-->
<Match>
- <!-- ignore thrift-generated classes -->
- <Package name="org.apache.accumulo.tracer.thrift" />
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
diff --git a/server/base/src/test/java/org/apache/accumulo/server/ServerConstantsTest.java b/server/base/src/test/java/org/apache/accumulo/server/ServerConstantsTest.java
index 87203d8..e7eec70 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/ServerConstantsTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/ServerConstantsTest.java
@@ -36,6 +36,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class ServerConstantsTest {
AccumuloConfiguration conf = DefaultConfiguration.getInstance();
diff --git a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeUtilTest.java b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeUtilTest.java
index 9693193..dbe2937 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeUtilTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeUtilTest.java
@@ -37,6 +37,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class VolumeUtilTest {
@Rule
diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java b/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java
index 0441b02..994c557 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/util/FileUtilTest.java
@@ -41,6 +41,9 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.rules.TestName;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class FileUtilTest {
@SuppressWarnings("deprecation")
private static Property INSTANCE_DFS_DIR = Property.INSTANCE_DFS_DIR;
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/server/master/src/main/spotbugs/exclude-filter.xml
similarity index 82%
copy from server/tracer/src/main/spotbugs/exclude-filter.xml
copy to server/master/src/main/spotbugs/exclude-filter.xml
index ce11cf3..5626c2d 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/server/master/src/main/spotbugs/exclude-filter.xml
@@ -20,7 +20,8 @@
can be excluded inline by adding the @SuppressFBWarnings annotation.
-->
<Match>
- <!-- ignore thrift-generated classes -->
- <Package name="org.apache.accumulo.tracer.thrift" />
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/server/tracer/src/main/spotbugs/exclude-filter.xml
index ce11cf3..6a6e3f3 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/server/tracer/src/main/spotbugs/exclude-filter.xml
@@ -23,4 +23,9 @@
<!-- ignore thrift-generated classes -->
<Package name="org.apache.accumulo.tracer.thrift" />
</Match>
+ <Match>
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
+ </Match>
</FindBugsFilter>
diff --git a/server/tracer/src/main/spotbugs/exclude-filter.xml b/server/tserver/src/main/spotbugs/exclude-filter.xml
similarity index 82%
copy from server/tracer/src/main/spotbugs/exclude-filter.xml
copy to server/tserver/src/main/spotbugs/exclude-filter.xml
index ce11cf3..5626c2d 100644
--- a/server/tracer/src/main/spotbugs/exclude-filter.xml
+++ b/server/tserver/src/main/spotbugs/exclude-filter.xml
@@ -20,7 +20,8 @@
can be excluded inline by adding the @SuppressFBWarnings annotation.
-->
<Match>
- <!-- ignore thrift-generated classes -->
- <Package name="org.apache.accumulo.tracer.thrift" />
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
</Match>
</FindBugsFilter>
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index a904a71..a7b72db 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -67,6 +67,9 @@ import org.junit.rules.TemporaryFolder;
import com.google.common.collect.ImmutableMap;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class InMemoryMapTest {
private static class SampleIE implements IteratorEnvironment {
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsReaderTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsReaderTest.java
index 2bf806f..34a36f4 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsReaderTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/RecoveryLogsReaderTest.java
@@ -44,6 +44,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class RecoveryLogsReaderTest {
VolumeManager fs;
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
index 52a8782..7a9cdf1 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java
@@ -59,6 +59,9 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class SortedLogRecoveryTest {
static final KeyExtent extent = new KeyExtent(TableId.of("table"), null, null);
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
index 595d23b..0099655 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java
@@ -41,6 +41,7 @@ import org.junit.rules.TemporaryFolder;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class TestUpgradePathForWALogs {
private static final String WALOG_FROM_15 = "/walog-from-15.walog";
@@ -72,7 +73,6 @@ public class TestUpgradePathForWALogs {
fs.create(SortedLogState.getFinishedMarkerPath(manyMapsPath)).close();
}
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "path provided by test code")
@Test
public void testUpgradeOf15WALog() throws IOException {
InputStream walogStream = null;
@@ -107,7 +107,6 @@ public class TestUpgradePathForWALogs {
}
}
- @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "path provided by test code")
@Test
public void testBasic16WALogRead() throws IOException {
String walogToTest = WALOG_FROM_16;
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
index 2d338b8..3730306 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/RootFilesTest.java
@@ -39,6 +39,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class RootFilesTest {
@Rule
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 74b5ef2..eb6173a 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -525,6 +525,8 @@ public class Shell extends ShellOptions implements KeywordExecutable {
new Shell(new ConsoleReader()).execute(args);
}
+ @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
+ justification = "user-provided paths intentional")
public int start() throws IOException {
String input;
if (isVerbose()) {
diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
index e428c51..674c900 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/ShellOptionsJC.java
@@ -259,6 +259,8 @@ public class ShellOptionsJC {
return unrecognizedOptions;
}
+ @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
+ justification = "user-provided paths intentional")
public String getClientPropertiesFile() {
if (clientConfigFile == null) {
List<String> searchPaths = new LinkedList<>();
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
index 50b4648..fc5d089 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellUtilTest.java
@@ -33,6 +33,9 @@ import org.junit.rules.TemporaryFolder;
import com.google.common.collect.ImmutableList;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class ShellUtilTest {
@Rule
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
index c3806b5..d0c9f33 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
@@ -34,6 +34,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class AccumuloReloadingVFSClassLoaderTest {
private TemporaryFolder folder1 =
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoaderTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoaderTest.java
index 172e90f..384605e 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoaderTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoaderTest.java
@@ -40,6 +40,9 @@ import org.powermock.core.classloader.annotations.SuppressStaticInitializationFo
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
@RunWith(PowerMockRunner.class)
@PrepareForTest(AccumuloVFSClassLoader.class)
@SuppressStaticInitializationFor({"org.apache.accumulo.start.classloader.AccumuloVFSClassLoader",
diff --git a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
index 8d9f5fa..913ab43 100644
--- a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
+++ b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/ContextManagerTest.java
@@ -36,6 +36,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class ContextManagerTest {
private TemporaryFolder folder1 =
diff --git a/start/src/test/java/org/apache/accumulo/start/test/AccumuloDFSBase.java b/start/src/test/java/org/apache/accumulo/start/test/AccumuloDFSBase.java
index 777e9c1..33ca66c 100644
--- a/start/src/test/java/org/apache/accumulo/start/test/AccumuloDFSBase.java
+++ b/start/src/test/java/org/apache/accumulo/start/test/AccumuloDFSBase.java
@@ -35,6 +35,9 @@ import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
public class AccumuloDFSBase {
protected static Configuration conf = null;
diff --git a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
index 3bdc50a..e5bf812 100644
--- a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java
@@ -62,6 +62,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne
return type == ClusterType.MINI;
}
+ @SuppressFBWarnings(value = "URLCONNECTION_SSRF_FD", justification = "url is not from user")
@Test
public void testMonitorService() throws Exception {
final MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
index 84ce31e..62c8376 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/HalfDeadTServerIT.java
@@ -212,6 +212,8 @@ public class HalfDeadTServerIT extends ConfigurableMacBase {
}
}
+ @SuppressFBWarnings(value = "COMMAND_INJECTION",
+ justification = "command executed is not from user input")
private boolean makeDiskFailureLibrary() throws Exception {
String root = System.getProperty("user.dir");
String source = root + "/src/test/c/fake_disk_failure.c";
diff --git a/test/src/main/spotbugs/exclude-filter.xml b/test/src/main/spotbugs/exclude-filter.xml
index 54df747..cc18587 100644
--- a/test/src/main/spotbugs/exclude-filter.xml
+++ b/test/src/main/spotbugs/exclude-filter.xml
@@ -23,4 +23,13 @@
<!-- ignore thrift-generated files -->
<Package name="org.apache.accumulo.test.rpc.thrift" />
</Match>
+ <Match>
+ <!-- Must ignore these everywhere, because of a javac byte code generation bug -->
+ <!-- https://github.com/spotbugs/spotbugs/issues/756 -->
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
+ </Match>
+ <Match>
+ <!-- paths in test code are provided by user input -->
+ <Bug pattern="PATH_TRAVERSAL_IN" />
+ </Match>
</FindBugsFilter>