Adopt Jackson 2.13
Signed-off-by: jansupol <jan.supol@oracle.com>
diff --git a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/base/ProviderBase.java b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/base/ProviderBase.java
index e42e163..d1e3d93 100644
--- a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/base/ProviderBase.java
+++ b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/base/ProviderBase.java
@@ -63,6 +63,10 @@
*/
public final static String HEADER_CONTENT_TYPE_OPTIONS = "X-Content-Type-Options";
+ protected final static String CLASS_NAME_NO_CONTENT_EXCEPTION = "javax.ws.rs.core.NoContentException";
+
+ private final static String NO_CONTENT_MESSAGE = "No content (empty input stream)";
+
/**
* Looks like we need to worry about accidental
* data binding for types we shouldn't be handling. This is
@@ -192,9 +196,6 @@
protected final LRUMap<AnnotationBundleKey, EP_CONFIG> _writers
= new LRUMap<AnnotationBundleKey, EP_CONFIG>(16, 120);
- protected final AtomicReference<IOException> _noContentExceptionRef
- = new AtomicReference<IOException>();
-
/*
/**********************************************************
/* Life-cycle
@@ -207,9 +208,8 @@
}
/**
- * Constructor that is only added to resolve
- * issue #10; problems with combination of
- * RESTeasy and CDI.
+ * Constructor that is only added to resolve [jaxrs-providers#10]; problems
+ * with combination of RESTeasy and CDI.
* Should NOT be used by any code explicitly; only exists
* for proxy support.
*/
@@ -554,9 +554,8 @@
// negation: Boolean.TRUE means untouchable -> can not write
return !customUntouchable.booleanValue();
}
- /* Ok: looks like we must weed out some core types here; ones that
- * make no sense to try to bind from JSON:
- */
+ // Ok: looks like we must weed out some core types here; ones that
+ // make no sense to try to bind from JSON:
if (_isIgnorableForWriting(new ClassKey(type))) {
return false;
}
@@ -751,9 +750,8 @@
// negation: Boolean.TRUE means untouchable -> can not write
return !customUntouchable.booleanValue();
}
- /* Ok: looks like we must weed out some core types here; ones that
- * make no sense to try to bind from JSON:
- */
+ // Ok: looks like we must weed out some core types here; ones that
+ // make no sense to try to bind from JSON:
if (_isIgnorableForReading(new ClassKey(type))) {
return false;
}
@@ -797,14 +795,11 @@
if (JaxRSFeature.ALLOW_EMPTY_INPUT.enabledIn(_jaxRSFeatures)) {
return null;
}
- /* 05-Apr-2014, tatu: Trick-ee. NoContentFoundException only available in JAX-RS 2.0...
- * so need bit of obfuscated code to reach it.
- */
- IOException fail = _noContentExceptionRef.get();
- if (fail == null) {
- fail = _createNoContentException();
- }
- throw fail;
+ // 05-Apr-2014, tatu: Trick-ee. NoContentFoundException only available in JAX-RS 2.0...
+ // so need bit of obfuscated code to reach it.
+
+ // 20-Jan-2021, tatu: as per [jaxrs-providers#134], simplify
+ throw _createNoContentException();
}
Class<?> rawType = type;
if (rawType == JsonParser.class) {
@@ -990,13 +985,9 @@
{
return _untouchables.contains(typeKey);
}
-
- /**
- * @since 2.4
- */
- protected IOException _createNoContentException()
- {
- return new NoContentException("No content (empty input stream)");
+
+ protected IOException _createNoContentException() {
+ return new NoContentException(NO_CONTENT_MESSAGE);
}
/*
diff --git a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/json/PackageVersion.java b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/json/PackageVersion.java
index e8f885a..9974df6 100644
--- a/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/json/PackageVersion.java
+++ b/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/json/PackageVersion.java
@@ -11,7 +11,7 @@
*/
public final class PackageVersion implements Versioned {
public final static Version VERSION = VersionUtil.parseVersion(
- "2.11.3", "com.fasterxml.jackson.jaxrs", "jackson-jaxrs-json-provider");
+ "2.13.0", "com.fasterxml.jackson.jaxrs", "jackson-jaxrs-json-provider");
@Override
public Version version() {
diff --git a/pom.xml b/pom.xml
index ccc8e59..170803f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2125,7 +2125,7 @@
<hk2.jvnet.osgi.version>org.jvnet.hk2.*;version="[2.5,4)"</hk2.jvnet.osgi.version>
<hk2.config.version>5.1.0</hk2.config.version>
<httpclient.version>4.5.13</httpclient.version>
- <jackson.version>2.12.2</jackson.version>
+ <jackson.version>2.13.0</jackson.version>
<jackson1.version>1.9.13</jackson1.version>
<javassist.version>3.25.0-GA</javassist.version>
<jboss.logging.version>3.3.0.Final</jboss.logging.version>