Skip to content

Commit 99fe25f

Browse files
authored
Merge pull request #13 from tls-attacker/fix/string-concatenation-in-logger-statements
Fix string concatenation in logger statements
2 parents 74708eb + fc5951c commit 99fe25f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/de/rub/nds/crawler/targetlist/TargetFileProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public List<String> getTargetList() {
3939
} catch (IOException ex) {
4040
throw new RuntimeException("Could not load " + filename, ex);
4141
}
42-
LOGGER.info("Read " + targetList.size() + " hosts");
42+
LOGGER.info("Read {} hosts", targetList.size());
4343
return targetList;
4444
}
4545
}

src/main/java/de/rub/nds/crawler/targetlist/ZipFileProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public List<String> getTargetList() {
5050
fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
5151
fileOutputStream.close();
5252
} catch (IOException e) {
53-
LOGGER.error("Could not download the current " + listName + " list with error ", e);
53+
LOGGER.error("Could not download the current {} list with error ", listName, e);
5454
}
55-
LOGGER.info("Unzipping current " + listName + " list...");
55+
LOGGER.info("Unzipping current {} list...", listName);
5656
try (InflaterInputStream zis = getZipInputStream(zipFilename)) {
5757
if (zis instanceof ZipInputStream) {
5858
((ZipInputStream) zis).getNextEntry();
@@ -67,9 +67,9 @@ public List<String> getTargetList() {
6767
}
6868
fos.close();
6969
} catch (IOException e) {
70-
LOGGER.error("Could not unzip the current " + listName + " list with error ", e);
70+
LOGGER.error("Could not unzip the current {} list with error ", listName, e);
7171
}
72-
LOGGER.info("Reading first {} hosts from current " + listName + " list...", number);
72+
LOGGER.info("Reading first {} hosts from current {} list...", number, listName);
7373
// currently hosts are in order. e.g. top 1000 hosts come first but that does not have to be
7474
// the case. Therefore, we parse every line until we hit the specified number of hosts
7575
try (Stream<String> lines = Files.lines(Paths.get(outputFile))) {
@@ -81,12 +81,12 @@ public List<String> getTargetList() {
8181
try {
8282
Files.delete(Path.of(zipFilename));
8383
} catch (IOException e) {
84-
LOGGER.error("Could not delete " + zipFilename + ": ", e);
84+
LOGGER.error("Could not delete {}: ", zipFilename, e);
8585
}
8686
try {
8787
Files.delete(Path.of(outputFile));
8888
} catch (IOException e) {
89-
LOGGER.error("Could not delete " + outputFile + ": ", e);
89+
LOGGER.error("Could not delete {}: ", outputFile, e);
9090
}
9191
return targetList;
9292
}

0 commit comments

Comments
 (0)