diff --git a/site-validation/bad-image-issue.java b/site-validation/bad-image-issue.java index bb6f70056f9c..e5a243bfadc2 100644 --- a/site-validation/bad-image-issue.java +++ b/site-validation/bad-image-issue.java @@ -174,18 +174,14 @@ private List 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) {