Skip to content

Commit

Permalink
Merge pull request #188 from ate47/fix_kcat_closer
Browse files Browse the repository at this point in the history
Fix issue with closer if the diffcat isn't used but an error is thrown
  • Loading branch information
D063520 authored Feb 1, 2023
2 parents 4e823ec + aba805e commit a0d4dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public KCatImpl(List<String> hdtFileNames, List<? extends Bitmap> deleteBitmaps,
throw t;
} finally {
try {
Closer.closeAll((Object[]) deleteBitmapTriples);
Closer.closeAll((Object) deleteBitmapTriples);
} finally {
for (HDT hdt : hdts) {
IOUtil.closeQuietly(hdt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand All @@ -20,7 +19,11 @@ public class Closer implements Iterable<Closeable>, Closeable {
private final List<Closeable> list;

private Closer(Object... other) {
list = new ArrayList<>(other.length);
if (other != null) {
list = new ArrayList<>(other.length);
} else {
list = new ArrayList<>();
}
with(other);
}

Expand Down

0 comments on commit a0d4dbf

Please sign in to comment.