From 080fe2001e6acfa7ea953fe909d501036ddc974f Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Mon, 30 Oct 2023 15:53:03 +0100 Subject: [PATCH] Fix Code smells --- .../jplag/reporting/jsonfactory/ComparisonReportWriter.java | 4 ++-- .../de/jplag/reporting/reportobject/writer/DummyWriter.java | 3 ++- .../reportobject/mapper/ComparisonReportWriterTest.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java index 8b0a10737..2147761a0 100644 --- a/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java +++ b/core/src/main/java/de/jplag/reporting/jsonfactory/ComparisonReportWriter.java @@ -24,12 +24,12 @@ */ public class ComparisonReportWriter { - private final FileWriter fileWriter; + private final FileWriter fileWriter; private final Function submissionToIdFunction; private final Map> submissionIdToComparisonFileName = new ConcurrentHashMap<>(); private final Map fileNameCollisions = new ConcurrentHashMap<>(); - public ComparisonReportWriter(Function submissionToIdFunction, FileWriter fileWriter) { + public ComparisonReportWriter(Function submissionToIdFunction, FileWriter fileWriter) { this.submissionToIdFunction = submissionToIdFunction; this.fileWriter = fileWriter; } diff --git a/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyWriter.java b/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyWriter.java index 1f39def90..be301b9c5 100644 --- a/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyWriter.java +++ b/core/src/main/java/de/jplag/reporting/reportobject/writer/DummyWriter.java @@ -5,9 +5,10 @@ public class DummyWriter implements FileWriter { private static final Logger logger = LoggerFactory.getLogger(DummyWriter.class); + private static final String MESSAGE = "DummyWriter writes object {} to path {} with name {} as JSON."; @Override public void writeFile(Object fileToSave, String folderPath, String fileName) { - logger.info("DummyWriter writes object " + fileToSave + " to path " + folderPath + " with name " + fileName + " as JSON."); + logger.info(MESSAGE, fileToSave, folderPath, fileName); } } diff --git a/core/src/test/java/de/jplag/reporting/reportobject/mapper/ComparisonReportWriterTest.java b/core/src/test/java/de/jplag/reporting/reportobject/mapper/ComparisonReportWriterTest.java index 22b725798..2af3fd15a 100644 --- a/core/src/test/java/de/jplag/reporting/reportobject/mapper/ComparisonReportWriterTest.java +++ b/core/src/test/java/de/jplag/reporting/reportobject/mapper/ComparisonReportWriterTest.java @@ -14,7 +14,7 @@ import de.jplag.reporting.reportobject.writer.FileWriter; public class ComparisonReportWriterTest extends TestBase { - private final FileWriter fileWriter = new DummyWriter(); + private final FileWriter fileWriter = new DummyWriter(); @Test public void firsLevelOfLookupMapComplete() throws ExitException {