Skip to content

Commit

Permalink
Merge branch '2.12' into 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 26, 2021
2 parents 2f49334 + 5b307c1 commit d2ddfd1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.fasterxml.jackson.datatype.jsr310.misc;

import java.time.temporal.TemporalAdjuster;
import java.time.temporal.TemporalAdjusters;

import org.junit.Assert;
import org.junit.Test;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.ModuleTestBase;

public class UnsupportedTypesTest extends ModuleTestBase
{
// [modules-java8#207]
static class TAWrapper {
public TemporalAdjuster a;

public TAWrapper(TemporalAdjuster a) {
this.a = a;
}
}

// [modules-java#207]: should not fail on `TemporalAdjuster`
@Test
public void testTemporalAdjusterSerialization() throws Exception
{
ObjectMapper mapper = newMapper();

// Not 100% sure how this happens, actually; should fail on empty "POJO"?
Assert.assertEquals(a2q("{'a':{}}"),
mapper.writeValueAsString(new TAWrapper(TemporalAdjusters.firstDayOfMonth())));
}
}
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,8 @@ Oriol Barcelona (obarcelonap@github)
* Contributed fix for #189: Support use of "pattern" (`ChronoUnit`) for
`DurationSerializer` too
(2.12.0)

Gökhan Öner (gokhanoner@github)
* Reported #207: Fail to serialize `TemporalAdjuster` type with 2.12
(2.12.3)

5 changes: 5 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Modules:

No changes since 2.12

2.12.3 (not yet released)

#207: Fail to serialize `TemporalAdjuster` type with 2.12
(reported by Gökhan Ö)

2.12.2 (03-Mar-2021)

#202: Unable to deserialize `YearMonth` when running as java9 module,
Expand Down

0 comments on commit d2ddfd1

Please sign in to comment.