summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-12-03 01:49:18 +0100
committerChristian Halstrick <christian.halstrick@sap.com>2020-12-17 18:41:52 +0100
commit3705ac58391f979d2a7b6689dd96d6531e975c53 (patch)
tree75ff8b22cb3a28b5395d7397be7e6c735bf9733a /org.eclipse.jgit.test
parenta2bb540f2998689ae9c7f894ca5d74c6c55f9127 (diff)
downloadjgit-3705ac58391f979d2a7b6689dd96d6531e975c53.tar.gz
jgit-3705ac58391f979d2a7b6689dd96d6531e975c53.zip
[spotbugs] Fix potential NPE in GcPruneNonReferencedTest
File#listFiles can return null, assert it is not null to fix the warning. Change-Id: I28fc668fee760d39965e6e039003ac9f85fd461b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java
index 796df3db06..7386621204 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPruneNonReferencedTest.java
@@ -12,6 +12,7 @@ package org.eclipse.jgit.internal.storage.file;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -89,6 +90,7 @@ public class GcPruneNonReferencedTest extends GcTestCase {
private void assertNoEmptyFanoutDirectories() {
File[] fanout = repo.getObjectsDirectory().listFiles();
+ assertNotNull(fanout);
for (File f : fanout) {
if (f.isDirectory()) {
String[] entries = f.list();