[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:
parent
a2bb540f29
commit
3705ac5839
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -89,6 +90,7 @@ public void testPackCommitsAndLooseOneWithPruneNow() throws Exception {
|
||||||
|
|
||||||
private void assertNoEmptyFanoutDirectories() {
|
private void assertNoEmptyFanoutDirectories() {
|
||||||
File[] fanout = repo.getObjectsDirectory().listFiles();
|
File[] fanout = repo.getObjectsDirectory().listFiles();
|
||||||
|
assertNotNull(fanout);
|
||||||
for (File f : fanout) {
|
for (File f : fanout) {
|
||||||
if (f.isDirectory()) {
|
if (f.isDirectory()) {
|
||||||
String[] entries = f.list();
|
String[] entries = f.list();
|
||||||
|
|
Loading…
Reference in New Issue