From a728d1f9c8db636e5d2803763b1315890c560782 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Fri, 6 Jul 2012 17:25:53 -0400 Subject: [PATCH] These must be called in the reverse order we open them --- .../util/blockmeta/HashChunkletManager.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java index e016cb3c0..f43487249 100644 --- a/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java +++ b/src/main/java/com/gmail/nossr50/util/blockmeta/HashChunkletManager.java @@ -261,18 +261,18 @@ public class HashChunkletManager implements ChunkletManager { ex.printStackTrace(); } finally { - if (fileOut != null) { + if (objOut != null) { try { - fileOut.close(); + objOut.close(); } catch (IOException ex) { ex.printStackTrace(); } } - if (objOut != null) { + if (fileOut != null) { try { - objOut.close(); + fileOut.close(); } catch (IOException ex) { ex.printStackTrace(); @@ -318,15 +318,6 @@ public class HashChunkletManager implements ChunkletManager { ex.printStackTrace(); } finally { - if (fileIn != null) { - try { - fileIn.close(); - } - catch (IOException ex) { - ex.printStackTrace(); - } - } - if (objIn != null) { try { objIn.close(); @@ -335,6 +326,15 @@ public class HashChunkletManager implements ChunkletManager { ex.printStackTrace(); } } + + if (fileIn != null) { + try { + fileIn.close(); + } + catch (IOException ex) { + ex.printStackTrace(); + } + } } return storeIn;