Skip to content

Commit

Permalink
Empty line at the top of Issues_DataSet.txt file removed & NPE becaus…
Browse files Browse the repository at this point in the history
…e of blank description field fixed (#168)

* #161 Empty line at the top of Issues_DataSet.txt file removed
#167 NPE because of blank description field fixed

* passed pmd check
  • Loading branch information
Prokhorovmax authored May 17, 2021
1 parent e40ffe3 commit 0caf137
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ public void create() throws IOException {
if (descriptionWriter != null) {
descriptionWriter.print(issue.getKey());
descriptionWriter.print(SEPARATOR);
descriptionWriter.println(TextUtil.simplify(issue.getDescription()));
String descriptionText = issue.getDescription();
if (descriptionText == null) {
descriptionWriter.println("No description");
} else {
descriptionWriter.println(TextUtil.simplify(descriptionText));
}
}
if (commentsWriter != null && !issue.getComments().isEmpty()) {
commentsWriter.print(issue.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public void create() throws IOException {
try (FileOutputStream fos = new FileOutputStream(dataSetFile, true);
OutputStreamWriter output = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
BufferedWriter writer = new BufferedWriter(output)) {
writer.newLine();
writeIssues(output, writer);
}
LOGGER.info("Data set file was updated: {}", dataSetFile.getCanonicalPath());
Expand Down

0 comments on commit 0caf137

Please sign in to comment.