[Git][java-team/jackson-jr][upstream] New upstream version 2.12.5
Markus Koschany (@apo)
gitlab at salsa.debian.org
Mon Sep 6 21:28:12 BST 2021
Markus Koschany pushed to branch upstream at Debian Java Maintainers / jackson-jr
Commits:
14857443 by Markus Koschany at 2021-09-06T22:22:07+02:00
New upstream version 2.12.5
- - - - -
23 changed files:
- README.md
- jr-all/pom.xml
- jr-annotation-support/pom.xml
- jr-objects/pom.xml
- jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSON.java
- + jr-objects/src/test/java/com/fasterxml/jackson/jr/failing/NullHandling78Test.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/IndentationTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/NullHandlingTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadBeansTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadFeaturesTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadMapTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadSimpleTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadWithCtorsTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/SimpleComposerTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/SimpleFieldTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/WriteSimpleTest.java
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/impl/ValueWriterLocatorTest.java
- jr-retrofit2/pom.xml
- jr-stree/pom.xml
- jr-stree/src/test/java/com/fasterxml/jackson/jr/stree/SimpleTraverseTest.java
- jr-stree/src/test/java/com/fasterxml/jackson/jr/stree/WriteViaCodecTest.java
- pom.xml
- release-notes/VERSION-2.x
Changes:
=====================================
README.md
=====================================
@@ -210,10 +210,13 @@ See section "Jackson-jr ValueReaders" of [Jackson-jr 2.10 improvements](https://
You can also check out unit test
- jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/impl/CustomValueReadersTest.java
+ jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/impl/CustomValueReadersTest.java
for sample usage.
+There is also a blog post [Enable support for java.time.* with Jackson-jr](https://www.andersaaberg.dk/2020/enable-support-for-java-time-with-jackson-jr/) which shows how to write custom readers/writers; in this
+case ones for Java 8 date/time types, but the concept is general.
+
### Using (some of) Jackson annotations
Jackson 2.11 added a new extension (a `JacksonJrExtension`) -- `jr-annotation-support` -- that adds support for a subset of Jackson annotations.
=====================================
jr-all/pom.xml
=====================================
@@ -4,7 +4,7 @@
<parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<artifactId>jackson-jr-all</artifactId>
<name>jackson-jr-all</name>
=====================================
jr-annotation-support/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<artifactId>jackson-jr-annotation-support</artifactId>
<packaging>bundle</packaging>
=====================================
jr-objects/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<artifactId>jackson-jr-objects</artifactId>
<packaging>bundle</packaging>
=====================================
jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/JSON.java
=====================================
@@ -343,7 +343,7 @@ public class JSON implements Versioned
}
// Important: has to come before 'std' instance, since it refers to it
- private final static int DEFAULT_FEATURES = Feature.defaults();
+ final static int DEFAULT_FEATURES = Feature.defaults();
public final static int CACHE_FLAGS = Feature.cacheBreakers();
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/failing/NullHandling78Test.java
=====================================
@@ -0,0 +1,146 @@
+package com.fasterxml.jackson.jr.failing;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.jr.ob.JSON;
+import com.fasterxml.jackson.jr.ob.TestBase;
+
+public class NullHandling78Test extends TestBase
+{
+ // [jackson-jr#78]
+ static class IntegerWrapper {
+ public Integer value;
+ }
+ static class IntPrimitiveWrapper {
+ public int value;
+ }
+ static class LongWrapper {
+ public Long value;
+ }
+ static class LongPrimitiveWrapper {
+ public long value;
+ }
+ static class BooleanWrapper {
+ public Boolean value;
+ }
+ static class BooleanPrimitiveWrapper {
+ public boolean value;
+ }
+ static class DoubleWrapper {
+ public Double value;
+ }
+ static class DoublePrimitiveWrapper {
+ public double value;
+ }
+
+ // Test to verify that outputting of nulls is configurable
+ public void testMapNullEntries() throws Exception
+ {
+ Map<String,Object> map = new LinkedHashMap<String,Object>();
+ map.put("a", 1);
+ map.put("b", null);
+ // By default we do NOT write null-valued entries:
+ assertEquals("{\"a\":1}", JSON.std.asString(map));
+ // but we can disable it easily
+ assertEquals("{\"a\":1,\"b\":null}",
+ JSON.std.with(JSON.Feature.WRITE_NULL_PROPERTIES).asString(map));
+ }
+
+ // [jackson-jr#78], int/Integer
+
+ public void testIntPrimitive() throws Exception
+ {
+ IntPrimitiveWrapper w = JSON.std.beanFrom(IntPrimitiveWrapper.class,
+ a2q("{'value':1}"));
+ assertEquals(1, w.value);
+
+ w = JSON.std.beanFrom(IntPrimitiveWrapper.class,
+ a2q("{'value':null}"));
+ assertEquals(0, w.value);
+ }
+
+ public void testIntWrapper() throws Exception
+ {
+ IntegerWrapper w = JSON.std.beanFrom(IntegerWrapper.class,
+ a2q("{'value':1}"));
+ assertEquals(Integer.valueOf(1), w.value);
+
+ w = JSON.std.beanFrom(IntegerWrapper.class,
+ a2q("{'value':null}"));
+ assertNull(w.value);
+ }
+
+ // [jackson-jr#78], long/Long
+
+ public void testLongPrimitive() throws Exception
+ {
+ LongPrimitiveWrapper w = JSON.std.beanFrom(LongPrimitiveWrapper.class,
+ a2q("{'value':2}"));
+ assertEquals(2L, w.value);
+
+ w = JSON.std.beanFrom(LongPrimitiveWrapper.class,
+ a2q("{'value':null}"));
+ assertEquals(0L, w.value);
+ }
+
+ public void testLongWrapper() throws Exception
+ {
+ LongWrapper w = JSON.std.beanFrom(LongWrapper.class,
+ a2q("{'value':2}"));
+ assertEquals(Long.valueOf(2L), w.value);
+
+ w = JSON.std.beanFrom(LongWrapper.class,
+ a2q("{'value':null}"));
+ assertNull(w.value);
+ }
+
+ // [jackson-jr#78], boolean/Boolean
+
+ public void testBooleanPrimitive() throws Exception
+ {
+ BooleanPrimitiveWrapper w = JSON.std.beanFrom(BooleanPrimitiveWrapper.class,
+ a2q("{'value':true}"));
+ assertTrue(w.value);
+
+ w = JSON.std.beanFrom(BooleanPrimitiveWrapper.class,
+ a2q("{'value':null}"));
+ assertFalse(w.value);
+ }
+
+ public void testBooleanWrapper() throws Exception
+ {
+ BooleanWrapper w = JSON.std.beanFrom(BooleanWrapper.class,
+ a2q("{'value':true}"));
+ assertEquals(Boolean.TRUE, w.value);
+
+ w = JSON.std.beanFrom(BooleanWrapper.class,
+ a2q("{'value':null}"));
+ assertNull(w.value);
+ }
+
+ // [jackson-jr#78], boolean/Boolean
+
+ public void testDoublePrimitive() throws Exception
+ {
+ DoublePrimitiveWrapper w = JSON.std.beanFrom(DoublePrimitiveWrapper.class,
+ a2q("{'value':0.25}"));
+ assertEquals(0.25, w.value);
+
+ w = JSON.std.beanFrom(DoublePrimitiveWrapper.class,
+ a2q("{'value':null}"));
+ // yeah yeah, not kosher wrt epsilon etc but...
+ assertEquals(0.0, w.value);
+ }
+
+ public void testDoubleWrapper() throws Exception
+ {
+ DoubleWrapper w = JSON.std.beanFrom(DoubleWrapper.class,
+ a2q("{'value':0.25}"));
+ assertEquals(Double.valueOf(0.25), w.value);
+
+ w = JSON.std.beanFrom(DoubleWrapper.class,
+ a2q("{'value':null}"));
+ assertNull(w.value);
+ }
+}
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/IndentationTest.java
=====================================
@@ -2,8 +2,6 @@ package com.fasterxml.jackson.jr.ob;
import java.util.*;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class IndentationTest extends TestBase
{
public void testSimpleList() throws Exception
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/NullHandlingTest.java
=====================================
@@ -3,8 +3,6 @@ package com.fasterxml.jackson.jr.ob;
import java.util.LinkedHashMap;
import java.util.Map;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class NullHandlingTest extends TestBase
{
// Test to verify that outputting of nulls is configurable
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadBeansTest.java
=====================================
@@ -3,7 +3,6 @@ package com.fasterxml.jackson.jr.ob;
import java.util.*;
import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.jr.ob.JSON;
public class ReadBeansTest extends TestBase
{
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadFeaturesTest.java
=====================================
@@ -1,7 +1,5 @@
package com.fasterxml.jackson.jr.ob;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class ReadFeaturesTest extends TestBase
{
static class IsBean {
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadMapTest.java
=====================================
@@ -3,7 +3,7 @@ package com.fasterxml.jackson.jr.ob;
import java.util.*;
import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.jr.ob.JSON;
+
import com.fasterxml.jackson.jr.ob.api.MapBuilder;
// for [jackson-jr#49], where `DeferredMap` explodes
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadSimpleTest.java
=====================================
@@ -9,7 +9,6 @@ import java.util.*;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.TreeNode;
-import com.fasterxml.jackson.jr.ob.JSON;
import com.fasterxml.jackson.jr.ob.JSON.Feature;
public class ReadSimpleTest extends TestBase
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/ReadWithCtorsTest.java
=====================================
@@ -1,7 +1,5 @@
package com.fasterxml.jackson.jr.ob;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class ReadWithCtorsTest extends TestBase
{
static class FromString {
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/SimpleComposerTest.java
=====================================
@@ -2,8 +2,6 @@ package com.fasterxml.jackson.jr.ob;
import java.util.*;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class SimpleComposerTest extends TestBase
{
public static class NameBean {
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/SimpleFieldTest.java
=====================================
@@ -1,7 +1,5 @@
package com.fasterxml.jackson.jr.ob;
-import com.fasterxml.jackson.jr.ob.JSON;
-
public class SimpleFieldTest extends TestBase
{
static class XY {
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/WriteSimpleTest.java
=====================================
@@ -7,7 +7,6 @@ import java.net.URI;
import java.net.URL;
import java.util.*;
-import com.fasterxml.jackson.jr.ob.JSON;
import com.fasterxml.jackson.jr.ob.JSON.Feature;
public class WriteSimpleTest extends TestBase
=====================================
jr-objects/src/test/java/com/fasterxml/jackson/jr/ob/impl/ValueWriterLocatorTest.java
=====================================
@@ -3,7 +3,6 @@ package com.fasterxml.jackson.jr.ob.impl;
import java.util.*;
import com.fasterxml.jackson.jr.ob.TestBase;
-import com.fasterxml.jackson.jr.ob.impl.ValueWriterLocator;
public class ValueWriterLocatorTest extends TestBase
{
=====================================
jr-retrofit2/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<artifactId>jackson-jr-retrofit2</artifactId>
<packaging>bundle</packaging>
=====================================
jr-stree/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<artifactId>jackson-jr-stree</artifactId>
<packaging>bundle</packaging>
=====================================
jr-stree/src/test/java/com/fasterxml/jackson/jr/stree/SimpleTraverseTest.java
=====================================
@@ -1,7 +1,6 @@
package com.fasterxml.jackson.jr.stree;
import com.fasterxml.jackson.core.*;
-import com.fasterxml.jackson.jr.stree.JacksonJrsTreeCodec;
public class SimpleTraverseTest extends JacksonJrTreeTestBase
{
=====================================
jr-stree/src/test/java/com/fasterxml/jackson/jr/stree/WriteViaCodecTest.java
=====================================
@@ -7,13 +7,6 @@ import java.util.*;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.TreeCodec;
import com.fasterxml.jackson.core.TreeNode;
-import com.fasterxml.jackson.jr.stree.JacksonJrsTreeCodec;
-import com.fasterxml.jackson.jr.stree.JrsArray;
-import com.fasterxml.jackson.jr.stree.JrsBoolean;
-import com.fasterxml.jackson.jr.stree.JrsNumber;
-import com.fasterxml.jackson.jr.stree.JrsObject;
-import com.fasterxml.jackson.jr.stree.JrsString;
-import com.fasterxml.jackson.jr.stree.JrsValue;
public class WriteViaCodecTest extends JacksonJrTreeTestBase
{
=====================================
pom.xml
=====================================
@@ -3,12 +3,12 @@
<parent>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-base</artifactId>
- <version>2.12.1</version>
+ <version>2.12.5</version>
</parent>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-parent</artifactId>
<name>Parent pom for Jackson jr components</name>
- <version>2.12.1</version>
+ <version>2.12.5</version>
<packaging>pom</packaging>
<description>Parent pom for Jackson jr components
</description>
@@ -26,7 +26,7 @@
<connection>scm:git:git at github.com:FasterXML/jackson-jr.git</connection>
<developerConnection>scm:git:git at github.com:FasterXML/jackson-jr.git</developerConnection>
<url>http://github.com/FasterXML/jackson-jr</url>
- <tag>jackson-jr-parent-2.12.1</tag>
+ <tag>jackson-jr-parent-2.12.5</tag>
</scm>
<properties>
=====================================
release-notes/VERSION-2.x
=====================================
@@ -1,9 +1,23 @@
Project: jackson-jr
+Major version: 2
+
+Modules:
+ jackson-jr-annotation-support
+ jackson-jr-objects
+ jackson-jr-retrofit2
+ jackson-jr-stree
------------------------------------------------------------------------
=== Releases ===
------------------------------------------------------------------------
+2.12.5 (27-Aug-2021)
+2.12.4 (06-Jul-2021)
+2.12.3 (12-Apr-2021)
+2.12.2 (03-Mar-2021)
+
+No changes since 2.12.1
+
2.12.1 (08-Jan-2021)
#76: Annotation-based introspector does not include super-class fields
View it on GitLab: https://salsa.debian.org/java-team/jackson-jr/-/commit/14857443db9b060bc2710829c18887f2316359b0
--
View it on GitLab: https://salsa.debian.org/java-team/jackson-jr/-/commit/14857443db9b060bc2710829c18887f2316359b0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210906/4076b232/attachment.htm>
More information about the pkg-java-commits
mailing list