diff --git a/app/config/checkstyle/checkstyle.xml b/app/config/checkstyle/checkstyle.xml index cab909b..091434e 100644 --- a/app/config/checkstyle/checkstyle.xml +++ b/app/config/checkstyle/checkstyle.xml @@ -1,7 +1,7 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> - - + + @@ -83,10 +83,10 @@ - - - - + + + + @@ -164,12 +164,12 @@ - - - + + + - + @@ -177,11 +177,11 @@ - + - + @@ -191,7 +191,7 @@ - + @@ -201,8 +201,6 @@ - - - + diff --git a/app/src/main/java/hexlet/code/App.java b/app/src/main/java/hexlet/code/App.java index 0bcabee..6dd41bd 100644 --- a/app/src/main/java/hexlet/code/App.java +++ b/app/src/main/java/hexlet/code/App.java @@ -12,7 +12,7 @@ @Command(name = "gendiff", mixinStandardHelpOptions = true, version = "gendiff 0.9", description = "Compares two configuration files and shows a difference.") -public class App implements Callable { +public final class App implements Callable { @Option(names = {"-f", "--format"}, paramLabel = "format", defaultValue = "stylish", description = "output format [default: stylish]") diff --git a/app/src/main/java/hexlet/code/source/Differ.java b/app/src/main/java/hexlet/code/source/Differ.java index 25f09a2..5c019a4 100644 --- a/app/src/main/java/hexlet/code/source/Differ.java +++ b/app/src/main/java/hexlet/code/source/Differ.java @@ -54,7 +54,7 @@ public static String generate(String filePath1, String filePath2, String format) stage = dataSecond.containsKey(key) ? ADDED : DELETED; } - List date = new ArrayList<>(3); + List date = new ArrayList<>(); date.add(stage); date.add(dataFirstValue); date.add(dataSecondValue); diff --git a/app/src/main/java/hexlet/code/source/formatters/Plain.java b/app/src/main/java/hexlet/code/source/formatters/Plain.java index 5f732c6..02d99c9 100644 --- a/app/src/main/java/hexlet/code/source/formatters/Plain.java +++ b/app/src/main/java/hexlet/code/source/formatters/Plain.java @@ -30,9 +30,6 @@ public static String plain(Map> differenceMap) { StringBuilder result = new StringBuilder(); differenceMap.forEach((key, value) -> { String addString = "Property '" + key + "' was "; - if (value.size() != 3) { - throw new IllegalArgumentException("Неподходящие данные"); - } var currentState = value.getFirst(); diff --git a/app/src/main/java/hexlet/code/source/formatters/Stylish.java b/app/src/main/java/hexlet/code/source/formatters/Stylish.java index 957e97c..44c8a84 100644 --- a/app/src/main/java/hexlet/code/source/formatters/Stylish.java +++ b/app/src/main/java/hexlet/code/source/formatters/Stylish.java @@ -11,10 +11,6 @@ public static String stylish(Map> differenceMap) { differenceMap.forEach((key, value) -> { String addedString = ""; - if (value.size() != 3) { - throw new IllegalArgumentException("Неподходящие данные"); - } - if (value.getFirst().equals(Differ.DELETED) || value.getFirst().equals(Differ.CHANGED)) { addedString += "- " + key + ": " + value.get(1) + "\n"; }