Skip to content

Commit

Permalink
Correct serialization logic
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Feb 26, 2024
1 parent e99d8c5 commit a3a520a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions site-validation/bad-image-issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,14 @@ private List<BadImage> readTestOutputFile() throws IOException {
Path filePath = FileSystems.getDefault()
.getPath(OUTPUT_PATH);
if (Files.exists(filePath)) {
return Files.lines(filePath)
.map(line -> {
try {
return new ObjectMapper().readValue(line, BadImage.class);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
})
.toList();
} else {
return Collections.emptyList();
}
try {
return new ObjectMapper().readValue(Files.lines(filePath), BadImage[].class);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
} else {
return Collections.emptyList();
}
}

public static void main(String... args) {
Expand Down

0 comments on commit a3a520a

Please sign in to comment.