Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ private String calcChecksum(File jarFile) throws IOException, NoSuchAlgorithmExc
MessageDigest digester = MessageDigest.getInstance("SHA-1");

try (FileInputStream is = new FileInputStream(jarFile)) {
DigestInputStream dis = new DigestInputStream(is, digester);

for (byte[] buffer = new byte[1024 * 4]; dis.read(buffer) >= 0; ) {
// just read it
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDE: 'just' might sound dismissive or oversimplify what readers consider a complex task

}
new DigestInputStream(is, digester).read(new byte[1024 * 4]); // only read required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is incorrect. There's no guarantee this read will read as much as is needed

}

byte[] digest = digester.digest();
Expand Down