Skip to content

Commit

Permalink
Merge branch '2.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 17, 2024
2 parents d13d70b + 4486d21 commit 396eaef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,22 @@ protected int _findSimpleType(Class<?> raw, boolean forSer)
if (UUID.class.isAssignableFrom(raw)) {
return SER_UUID;
}
/* May or may not help with deser, but recognized nonetheless;
* on assumption that Beans should rarely implement `CharSequence`
*/
// May or may not help with deser, but recognized nonetheless;
// on assumption that Beans should rarely implement `CharSequence`
if (CharSequence.class.isAssignableFrom(raw)) {
return SER_CHARACTER_SEQUENCE;
}
/* `Iterable` can be added on all kinds of things, and it won't
* help at all with deserialization; hence only use for serialization.
*/
// `Iterable` can be added on all kinds of things, and it won't
// help at all with deserialization; hence only use for serialization.
if (forSer && Iterable.class.isAssignableFrom(raw)) {
return SER_ITERABLE;
// 16-Feb-2024, tatu: [jackson-jr#112] java.nio.file.Path is not really Iterable
if (!java.nio.file.Path.class.isAssignableFrom(raw)) {
return SER_ITERABLE;
}
System.err.println("Iterable? "+raw.getName()+" -> NO");
}

// Ok. I give up, no idea!
return SER_UNKNOWN;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tools.jackson.jr.failing;
package tools.jackson.jr.ob.impl;

import java.io.File;
import java.nio.file.Path;
Expand All @@ -8,7 +8,6 @@

import tools.jackson.jr.ob.*;
import tools.jackson.jr.ob.api.*;
import tools.jackson.jr.ob.impl.JSONWriter;

public class ValueWriterModifier112Test extends TestBase
{
Expand Down Expand Up @@ -61,6 +60,6 @@ public ValueWriter findValueWriter(JSONWriter writeContext, Class<?> type) {
}
}).build();
String json = writer.asString(input);
assertEquals(a2q("{'p1':'some/path','p2':'some/other/path'}"), json);
assertEquals(a2q("{'p1':'some\\/path','p2':'some\\/other\\/path'}"), json);
}
}
6 changes: 6 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ Reed Passaretti (@reed53)

* Reported #107: Cannot deserialize `byte[]` from JSON `null` value
(2.15.3)

Julian Honnen (@jhonnen)

* Reported #112: `overrideStandardValueWriter` only applied to first `java.nio.file.Path`
valued field of bean
(2.17.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Modules:

#78: Deserializes "null" to "0.0" for `java.lang.Double` (wrapper)
(reported by @bill-phast)
#112: `overrideStandardValueWriter` only applied to first `java.nio.file.Path`
valued field of bean
(reported by Julian H)

2.16.1 (24-Dec-2023)

Expand Down

0 comments on commit 396eaef

Please sign in to comment.