[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>
This commit is contained in:
Matthias Sohn 2020-12-03 01:49:18 +01:00 committed by Christian Halstrick
parent a2bb540f29
commit 3705ac5839
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@
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 void testPackCommitsAndLooseOneWithPruneNow() throws Exception {
private void assertNoEmptyFanoutDirectories() {
File[] fanout = repo.getObjectsDirectory().listFiles();
assertNotNull(fanout);
for (File f : fanout) {
if (f.isDirectory()) {
String[] entries = f.list();