[FIXED JENKINS-18351] Better fix for file handle leak.

This commit is contained in:
Jesse Glick committed 2013-06-14 18:11:14 -04:00
1 parent 66cc975fba
commit 7f966f6f31
2 files changed
+8 -4

No files matched your search

+5 -1
View File
@@ -554,7 +554,11 @@ public class Util {
* @see DigestUtils#md5(InputStream)
*/
public static String getDigestOf(InputStream source) throws IOException {
return DigestUtils.md5Hex(source);
try {
return DigestUtils.md5Hex(source);
} finally {
source.close();
}
}
public static String getDigestOf(String text) {