Skip to content

Commit

Permalink
Fix Code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Oct 30, 2023
1 parent debfed5 commit 080fe20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/
public class ComparisonReportWriter {

private final FileWriter fileWriter;
private final FileWriter<Object> fileWriter;
private final Function<Submission, String> submissionToIdFunction;
private final Map<String, Map<String, String>> submissionIdToComparisonFileName = new ConcurrentHashMap<>();
private final Map<String, AtomicInteger> fileNameCollisions = new ConcurrentHashMap<>();

public ComparisonReportWriter(Function<Submission, String> submissionToIdFunction, FileWriter fileWriter) {
public ComparisonReportWriter(Function<Submission, String> submissionToIdFunction, FileWriter<Object> fileWriter) {
this.submissionToIdFunction = submissionToIdFunction;
this.fileWriter = fileWriter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

public class DummyWriter implements FileWriter<Object> {
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object> fileWriter = new DummyWriter();

@Test
public void firsLevelOfLookupMapComplete() throws ExitException {
Expand Down

0 comments on commit 080fe20

Please sign in to comment.