Skip to content

Commit deb09c8

Browse files
committed
Correct serialization logic
1 parent e99d8c5 commit deb09c8

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

site-validation/bad-image-issue.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,14 @@ private List<BadImage> readTestOutputFile() throws IOException {
174174
Path filePath = FileSystems.getDefault()
175175
.getPath(OUTPUT_PATH);
176176
if (Files.exists(filePath)) {
177-
return Files.lines(filePath)
178-
.map(line -> {
179-
try {
180-
return new ObjectMapper().readValue(line, BadImage.class);
181-
} catch (JsonProcessingException e) {
182-
throw new RuntimeException(e);
183-
}
184-
})
185-
.toList();
186-
} else {
187-
return Collections.emptyList();
188-
}
177+
try {
178+
return new ObjectMapper().readValue(Files.lines(filePath), BadImage[].class);
179+
} catch (JsonProcessingException e) {
180+
throw new RuntimeException(e);
181+
}
182+
} else {
183+
return Collections.emptyList();
184+
}
189185
}
190186

191187
public static void main(String... args) {

0 commit comments

Comments
 (0)