Skip to content

Commit cec5188

Browse files
committed
Merge branch '2.12' into 2.13
2 parents d3b6fec + 3f1f987 commit cec5188

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

guava/README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,38 @@ To use module on Maven-based projects, use following dependency:
1212
<dependency>
1313
<groupId>com.fasterxml.jackson.datatype</groupId>
1414
<artifactId>jackson-datatype-guava</artifactId>
15-
<version>2.11.1</version>
15+
<version>2.12.1</version>
1616
</dependency>
1717
```
1818

1919
(or whatever version is most up-to-date at the moment)
2020

2121
### Guava compatibility
2222

23-
Jackson 2.x versions up to and including 2.11.x:
23+
Although specific version of this module is built against particular Guava library version,
24+
and similarly defines dependency to just that version, module itself works against wider
25+
range of Guava versions.
2426

25-
* Should work on Guava versions `15.0` and later (currently up to 29.0-jre)
26-
* Require Guava version `20.0` or later to build (some tests depend on newer versions for verification)
27+
Following table shows the tested working ranges for recent module versions.
2728

28-
Minimum supported version is likely to be increased for Jackson 2.12 or later.
29+
| Module version | Min Guava | Default Guava | Max Guava |
30+
| -------------- | --------- | ------------- | --------- |
31+
| 2.12 | 14.0 | 21.0 | 29.0-jre |
32+
| 2.11 | 14.0 | 20.0 | 29.0-jre |
33+
| 2.10 | 14.0 | 20.0 | 29.0-jre |
34+
| 2.9 | 12.0 | 18.0 | 29.0-jre |
35+
36+
Notes:
37+
38+
* At the point of testing, `29.0-jre` was the latest available Guava library
39+
version, so all versions work with the latest Guava
40+
* "Min Guava" means the earliest version that integration tests passed with
41+
* "Default Guava" is the dependency specified in module's `pom.xml`: it is used for build, unit tests
42+
* note: building, unit tests work on a range but typically require higher version than "Min Guava"
2943

3044
### Registering module
3145

32-
Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows:
46+
Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows (Jackson 2.x up to 2.9)
3347

3448
```java
3549
// New (2.10+)
@@ -42,7 +56,15 @@ ObjectMapper mapper = new ObjectMapper()
4256
.registerModule(new GuavaModule());
4357
```
4458

45-
after which functionality is available for all normal Jackson operations.
59+
OR, the new method added in 2.10 (old method will work with 2.x but not 3.x):
60+
61+
```java
62+
ObjectMapper mapper = JsonMapper.builder()
63+
.addModule(new GuavaModule())
64+
.build();
65+
```
66+
67+
after which functionality is available with all normal Jackson operations.
4668

4769
### Configuration
4870

guava/src/test/java/com/fasterxml/jackson/datatype/guava/TestImmutables.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public void testWithoutSerializers() throws Exception
5555
ImmutableMap<String,Integer> map = ImmutableMap.<String,Integer>builder()
5656
.put("a", 1).put("b", 2).build();
5757
assertEquals("{\"a\":1,\"b\":2}", MAPPER.writeValueAsString(map));
58+
59+
assertEquals(a2q("{'message':'Hello, world!'}"),
60+
MAPPER.writeValueAsString(ImmutableMap.of("message", "Hello, world!")));
61+
assertEquals(a2q("{'id':3,'name':'Bob'}"),
62+
MAPPER.writeValueAsString(ImmutableMap.of("id", 3, "name", "Bob")));
63+
64+
assertEquals("[12,true,0.25]",
65+
MAPPER.writeValueAsString(ImmutableList.of(12, true, 0.25)));
5866
}
5967

6068
/**

release-notes/VERSION-2.x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Active Maintainers:
2020

2121
No changes since 2.12
2222

23-
2.12.2 (not yet released)
23+
2.12.2 (03-Mar-2021)
2424

2525
- Add missing "provides Module" for eclipse-collections module-info (JPMS)
2626

0 commit comments

Comments
 (0)