Skip to content

Commit 4b92a98

Browse files
committed
Merge branch '2.12' into 2.13
2 parents fb6c73a + 7149799 commit 4b92a98

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

mrbean/src/main/java/com/fasterxml/jackson/module/mrbean/AbstractTypeMaterializer.java

+2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ protected boolean _suitableType(JavaType type)
285285
|| (cls == CharSequence.class) || (cls == Iterable.class) || (cls == Iterator.class)
286286
// 06-Feb-2019, tatu: [modules-base#74] and:
287287
|| (cls == java.io.Serializable.class)
288+
// 23-Apr-2021, tatu: [modules-base#132] minimal patch
289+
|| (cls == java.util.TimeZone.class)
288290
) {
289291
return false;
290292
}

mrbean/src/test/java/com/fasterxml/jackson/module/mrbean/BaseTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected byte[] encodeInUTF32BE(String input)
158158
return result;
159159
}
160160

161-
public String quote(String str) {
161+
public String q(String str) {
162162
return '"'+str+'"';
163163
}
164164
}

mrbean/src/test/java/com/fasterxml/jackson/module/mrbean/TestJDKTypes.java

+17-2
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public void testIterable() throws Exception
6565

6666
public void testStringLike() throws Exception
6767
{
68-
CharSequence seq = MAPPER.readValue(quote("abc"), CharSequence.class);
68+
CharSequence seq = MAPPER.readValue(q("abc"), CharSequence.class);
6969
assertEquals("abc", (String) seq);
7070
}
7171

7272
// [modules-base#74]: more types to skip
7373
public void testSerializable() throws Exception
7474
{
7575
// Serializable value = MAPPER.readValue(quote("abc"), Serializable.class);
76-
Serializable value = new ObjectMapper().readValue(quote("abc"), Serializable.class);
76+
Serializable value = new ObjectMapper().readValue(q("abc"), Serializable.class);
7777
assertEquals("abc", (String) value);
7878
}
7979

@@ -90,4 +90,19 @@ public void testIntAsString() throws Exception
9090
assertEquals(EXP_JSON, VANILLA_MAPPER.writeValueAsString(new Bean117UsingJsonSerialize()));
9191
assertEquals(EXP_JSON, MAPPER.writeValueAsString(new Bean117UsingJsonSerialize()));
9292
}
93+
94+
// [modules-base#132]: Don't block "java.util.TimeZone"
95+
public void testUtilTimeZone() throws Exception
96+
{
97+
final String json = q("PST");
98+
99+
TimeZone tz1 = VANILLA_MAPPER.readValue(json, TimeZone.class);
100+
assertNotNull(tz1);
101+
102+
TimeZone tz2 = MAPPER.readValue(json, TimeZone.class);
103+
assertNotNull(tz2);
104+
105+
assertEquals(tz1.getID(), tz2.getID());
106+
}
93107
}
108+

release-notes/VERSION-2.x

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Modules:
1919

2020
2.12.4 (not yet released
2121

22-
#131: Failing to serialize `Thread` returned by `Thread.currentThread()` when Afterburner
23-
or Blackbird registered
22+
#131: (afterburner) Failing to serialize `Thread` returned by `Thread.currentThread()`
23+
when Afterburner or Blackbird registered
2424
(reported by Liudapeng@github)
25+
#132: (mrbean) (minimal) Prevent Mr Bean from materializing `java.util.TimeZone`
2526

2627
2.12.3 (12-Apr-2021)
2728
2.12.2 (03-Mar-2021)

0 commit comments

Comments
 (0)