From 59f87f77f8375a08fbbdb58dfadb7f3b01229c54 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Mon, 5 Mar 2018 21:55:55 -0500 Subject: [PATCH] Removed double-wrapped catches. --- .../EncryptionDetectionFileIngestModule.java | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index 094e7a1458..0e618ba9c9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -227,15 +227,9 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter } if (possiblyEncrypted) { - try { - calculatedEntropy = calculateEntropy(file); - if (calculatedEntropy >= minimumEntropy) { - return true; - } - } catch (ReadContentInputStreamException ex) { - throw new ReadContentInputStreamException("Unable to calculate the entropy.", ex); - } catch (IOException ex) { - throw new IOException("Unable to calculate the entropy.", ex); + calculatedEntropy = calculateEntropy(file); + if (calculatedEntropy >= minimumEntropy) { + return true; } } @@ -289,20 +283,12 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter return -entropyAccumulator; - } catch (ReadContentInputStreamException ex) { - throw new ReadContentInputStreamException("Exception occurred while trying to read data from ReadContentInputStream.", ex); - } catch (IOException ex) { - throw new IOException("Exception occurred while trying to read data from BufferedInputStream.", ex); } finally { - try { - if (in != null) { - in.close(); - } - if (bin != null) { - bin.close(); - } - } catch (IOException ex) { - throw new IOException("Failed to close InputStream.", ex); + if (in != null) { + in.close(); + } + if (bin != null) { + bin.close(); } } }