diff --git a/processing/src/test/java/io/druid/segment/IndexBuilder.java b/processing/src/test/java/io/druid/segment/IndexBuilder.java index 5626f30b2b1..35d2611ba3e 100644 --- a/processing/src/test/java/io/druid/segment/IndexBuilder.java +++ b/processing/src/test/java/io/druid/segment/IndexBuilder.java @@ -118,8 +118,7 @@ public class IndexBuilder { Preconditions.checkNotNull(indexMerger, "indexMerger"); Preconditions.checkNotNull(tmpDir, "tmpDir"); - final IncrementalIndex incrementalIndex = buildIncrementalIndex(); - try { + try (final IncrementalIndex incrementalIndex = buildIncrementalIndex()) { return TestHelper.getTestIndexIO().loadIndex( indexMerger.persist( incrementalIndex,