Skip to content

Commit

Permalink
Pull request #396: Making sure to close streams in the opposite order…
Browse files Browse the repository at this point in the history
… of creation.

Merge in MC/connect from bugfix/ROCKSOLID-5536-error-installing-new-plugins-in-mc-3.10 to 3.10.x

* commit '0df67f9c7de6305ac17f680602ab92dfed5817d4':
  Making sure to close streams in the opposite order of creation.
  • Loading branch information
Christopher Turczynskyj authored and Christopher Turczynskyj committed Jan 5, 2021
2 parents 2a75b3a + 0df67f9 commit aaf70d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,9 @@ void extractZipEntry(ZipEntry entry, File installTempDir, ZipFile zipFile) throw
outputStream = new BufferedOutputStream(fileOutputStream);
IOUtils.copy(zipInputStream, outputStream);
} finally {
ResourceUtil.closeResourceQuietly(zipInputStream);
ResourceUtil.closeResourceQuietly(fileOutputStream);
ResourceUtil.closeResourceQuietly(outputStream);
ResourceUtil.closeResourceQuietly(fileOutputStream);
ResourceUtil.closeResourceQuietly(zipInputStream);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ private String getDigest(File directory, String filePath) throws Exception {

return Base64.getEncoder().encodeToString(digest.digest());
} finally {
ResourceUtil.closeResourceQuietly(fis);
ResourceUtil.closeResourceQuietly(bis);
ResourceUtil.closeResourceQuietly(fis);
}
}
}

0 comments on commit aaf70d4

Please sign in to comment.