File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
main/java/com/fasterxml/jackson/jr/ob/impl
test/java/com/fasterxml/jackson/jr/ob Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,8 @@ protected String dateToString(Date v) {
789
789
* @since 2.17
790
790
*/
791
791
protected String pathToString (Path value ) {
792
- return value .toUri ().toString ();
792
+ // return value.toUri().toString();
793
+ return value .toString ();
793
794
}
794
795
795
796
/*
Original file line number Diff line number Diff line change @@ -278,7 +278,8 @@ protected Path _readPath(JsonParser p) throws IOException {
278
278
}
279
279
String v = p .getValueAsString ();
280
280
try {
281
- return Paths .get (new URI (v ));
281
+ // return Paths.get(new URI(v));
282
+ return Paths .get (new File (v ).toURI ());
282
283
} catch (Exception e ) {
283
284
throw new JSONObjectException ("Failed to bind `java.nio.file.Path` from value '" +v +"'" );
284
285
}
Original file line number Diff line number Diff line change @@ -127,9 +127,9 @@ public void testKnownSimpleTypeFile() throws Exception
127
127
public void testKnownSimpleTypePath () throws Exception
128
128
{
129
129
Path p = Paths .get (new URI ("file:///foo/bar.txt" ));
130
- assertEquals (q ("file:// /foo/bar.txt" ), JSON .std .asString (p ));
130
+ assertEquals (q ("/foo/bar.txt" ), JSON .std .asString (p ));
131
131
132
- assertEquals (a2q ("{'path':'file:// /foo/bar.txt'}" ), JSON .std .asString (new PathWrapper (p )));
132
+ assertEquals (a2q ("{'path':'/foo/bar.txt'}" ), JSON .std .asString (new PathWrapper (p )));
133
133
}
134
134
135
135
public void testSimpleEnumTypes () throws Exception
You can’t perform that action at this time.
0 commit comments