Conversation
|
а чего оно от Lazy растёт, а не от мастера? |
jzuken
reviewed
Apr 8, 2017
| import java.util.List; | ||
| import java.util.concurrent.RecursiveTask; | ||
|
|
||
| class ChecksumTask extends RecursiveTask<byte[]> { |
|
|
||
| public class CLI { | ||
| public static void main(String[] args) throws IOException { | ||
| for (String path : args) { |
There was a problem hiding this comment.
ну хорошо бы всё же вывести что-то, если пользователь не передал аргументов
|
|
||
| @Override | ||
| public byte[] calcChecksum(Path path) throws IOException { | ||
| InputStream inputStream = Files.newInputStream(path); |
| bytesRead = inputStream.read(cache, 0, CACHE_SIZE); | ||
| messageDigest.update(cache, 0, bytesRead); | ||
| } | ||
| return messageDigest.digest(); } |
There was a problem hiding this comment.
закрывающая скобка явно не на своём месте
|
|
||
| private byte[] calcRecursively(Path path) throws IOException { | ||
| if (!Files.isDirectory(path)) { | ||
| return new SingleFileChecksumCalculator().calcChecksum(path); |
There was a problem hiding this comment.
вот это воистину странное решение, я то думал вы отнаследуетесь от этого класса. а так создавать кучу объектов на ровном месте непонятно зачем
|
|
||
| class ChecksumTask extends RecursiveTask<byte[]> { | ||
| private static final String MD5 = "MD5"; | ||
| private static final String NO_SUCH_ALGORITHM_MD5 = "Well, there's no MD5 algorithm in Java..."; |
There was a problem hiding this comment.
зачем же одни и те же константы по нескольку раз объявлять?
|
6.5 баллов |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.