From f4cc8c2b2f25cba84cfd2a6f5fdb8418967c1099 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Fri, 2 Dec 2016 14:56:34 -0800 Subject: [PATCH] IndexBuilder: Close IncrementalIndex when done. (#3734) --- processing/src/test/java/io/druid/segment/IndexBuilder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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,