Skip to content

Commit df27bbf

Browse files
Fix NullPointerException in JsonSchemaDraft4Test logging
- Replace ((Path) null).getFileName() with hardcoded filename - Addresses Copilot review comments about potential NPE Co-authored-by: openhands <[email protected]>
1 parent 363fee2 commit df27bbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json-java21-schema/src/test/java/io/github/simbo1905/json/schema/JsonSchemaDraft4Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ public Stream<DynamicTest> testId() throws JsonProcessingException {
8484
try {
8585
Assertions.assertEquals(expected, actual);
8686
} catch (AssertionError e) {
87-
LOG.fine(() -> "Assertion failed: " + groupDesc + " — expected=" + expected + ", actual=" + actual + " (" + ((Path) null).getFileName() + ")");
87+
LOG.fine(() -> "Assertion failed: " + groupDesc + " — expected=" + expected + ", actual=" + actual + " (JsonSchemaDraft4Test.java)");
8888
throw e;
8989
}
9090

9191
}));
9292
} catch (Exception ex) {
9393
/// Unsupported schema for this group; emit a single skipped test for visibility
9494
final var reason = ex.getMessage() == null ? ex.getClass().getSimpleName() : ex.getMessage();
95-
LOG.fine(()->"Skipping group due to unsupported schema: " + groupDesc + " — " + reason + " (" + ((Path) null).getFileName() + ")");
95+
LOG.fine(()->"Skipping group due to unsupported schema: " + groupDesc + " — " + reason + " (JsonSchemaDraft4Test.java)");
9696

9797
return Stream.of(DynamicTest.dynamicTest(groupDesc + " – SKIPPED: " + reason, () -> {
9898
if (JsonSchemaCheckIT.isStrict()) throw ex;

0 commit comments

Comments
 (0)