Skip to content

cw#10

Open
ArtyomLobanov wants to merge 1 commit into
masterfrom
cw
Open

cw#10
ArtyomLobanov wants to merge 1 commit into
masterfrom
cw

Conversation

@ArtyomLobanov
Copy link
Copy Markdown
Owner

No description provided.

@ArtyomLobanov
Copy link
Copy Markdown
Owner Author

нет yml, поэтому не проходит

Comment thread src/main/java/Tester.java
public class Tester {
public static void main(String[] args) throws Exception {
// String path = args[0];
String path = "C:\\workspace";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

закомментированная строка тоже грустная, кстати, хорошо бы проверить, что аргументы вообще передали

if (!file.exists()) {
throw new FileNotFoundException(file.getAbsolutePath());
}
FileInputStream input = new FileInputStream(file);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

при чтении из файла лучше пользоваться try-with-resources

if (files == null) {
throw new ForkJoinTaskException(new IOException("Cant retrieve files"));
}
ArrayList<ParallelHashCalculator> calculators = new ArrayList<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

лучше бы List<ParallelHashCalculator> calculators = new ArrayList<>();

Comment thread src/main/java/Tester.java
import java.io.File;
import java.util.Arrays;

public class Tester {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

а тут бы тоже не помешали комментарии. по-хорошему их надо писать ко всему, что public

Comment thread src/main/java/Tester.java
@@ -0,0 +1,18 @@
import java.io.File;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

нехорошо всё в дефолтный пакет класть

import org.junit.Test;

import java.io.File;
import java.io.FileNotFoundException;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

неиспользуемые импорты лучше убирать


public class HashMD5Test {

private static final String workspace = "test_workspace";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

* @throws FileNotFoundException if some file was not found
* @throws IOException if its occured during file reading
*/
private static byte[] hashFile(@NotNull File file) throws NoSuchAlgorithmException, IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NotNull'ов можно было и побольше поставить

@jzuken
Copy link
Copy Markdown

jzuken commented Apr 8, 2017

8.5 баллов

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants