Skip to content

Commit fe52706

Browse files
committed
bugfix checkstyle
1 parent ca3afb5 commit fe52706

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

app/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ run-dist: build install
1919
run-help: build install
2020
./build/install/app/bin/app -h
2121

22-
run-json: build install
22+
run-stylish: build install
2323
./build/install/app/bin/app -f=stylish ./src/main/java/resources/json/FirstJsonFile.json ./src/main/java/resources/json/SecondJsonFile.json
2424

25+
run-plain: build install
26+
./build/install/app/bin/app -f=plain ./src/main/java/resources/json/FirstJsonFile.json ./src/main/java/resources/json/SecondJsonFile.json
27+
28+
run-json: build install
29+
./build/install/app/bin/app -f=json ./src/main/java/resources/json/FirstJsonFile.json ./src/main/java/resources/json/SecondJsonFile.json
30+
31+
2532
.PHONY: build

app/src/main/java/hexlet/code/Differ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
public class Differ {
14-
public final static String DEFAULT_FORMAT = "stylish";
14+
public static final String DEFAULT_FORMAT = "stylish";
1515

1616
public static String generate(String filePath1, String filePath2, String format) throws IOException {
1717
var normalizedPath1 = FileManager.normaolizePath(Path.of(filePath1));

app/src/main/java/hexlet/code/TreeBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public class TreeBuilder {
1414
public static final String UNCHANGED = "UNCHANGED";
1515

1616
public static Map<String, List<Object>> getTreeDifference(Map<String, Object> firstDataMap,
17-
Map<String, Object> SecondDataMap) {
17+
Map<String, Object> secondDataMap) {
1818

1919
Map<String, List<Object>> result = new TreeMap<>();
2020
Set<String> keySet = new TreeSet<>(firstDataMap.keySet());
21-
keySet.addAll(SecondDataMap.keySet());
21+
keySet.addAll(secondDataMap.keySet());
2222

2323
keySet.forEach(key -> {
2424
String stage;
2525
var dataFirstValue = firstDataMap.get(key) == null ? "null" : firstDataMap.get(key);
26-
var dataSecondValue = SecondDataMap.get(key) == null ? "null" : SecondDataMap.get(key);
26+
var dataSecondValue = secondDataMap.get(key) == null ? "null" : secondDataMap.get(key);
2727

28-
if (firstDataMap.containsKey(key) && SecondDataMap.containsKey(key)) {
28+
if (firstDataMap.containsKey(key) && secondDataMap.containsKey(key)) {
2929

3030
stage = (dataFirstValue.equals(dataSecondValue)) ? UNCHANGED : CHANGED;
3131

3232
} else {
33-
stage = SecondDataMap.containsKey(key) ? ADDED : DELETED;
33+
stage = secondDataMap.containsKey(key) ? ADDED : DELETED;
3434
}
3535

3636
List<Object> date = new ArrayList<>();

app/src/main/java/hexlet/code/formatters/Plain.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package hexlet.code.formatters;
22

3-
import hexlet.code.Differ;
43
import hexlet.code.TreeBuilder;
54

65
import java.util.List;

app/src/main/java/hexlet/code/formatters/Stylish.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package hexlet.code.formatters;
22

3-
import hexlet.code.Differ;
43
import hexlet.code.TreeBuilder;
54

65
import java.util.List;

app/src/test/java/source/TestDiffer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void testWrongPathFile() {
8585

8686
@Test
8787
public void testGenerateWithSomeFile() throws IOException {
88-
String differs = readReroptAsString(Path.of("src/test/java/fixtures/Stylish_same_file"));
88+
String differs = readReroptAsString(Path.of("src/test/java/resources/fixtures/Stylish_same_file"));
8989
var formant = "stylish";
9090
String differenceJson = Differ.generate(firstTestJsonFilePath, firstTestJsonFilePath, formant);
9191
assertEquals(differenceJson, differs);

0 commit comments

Comments
 (0)