Skip to content

Commit d5de36e

Browse files
authored
Merge pull request #4932 from senivam/31_merged
merge actual master into 3.1
2 parents 0f8d753 + b5cb79c commit d5de36e

File tree

3 files changed

+20
-29
lines changed

3 files changed

+20
-29
lines changed

media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/base/ProviderBase.java

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public abstract class ProviderBase<
6363
*/
6464
public final static String HEADER_CONTENT_TYPE_OPTIONS = "X-Content-Type-Options";
6565

66+
protected final static String CLASS_NAME_NO_CONTENT_EXCEPTION = "javax.ws.rs.core.NoContentException";
67+
68+
private final static String NO_CONTENT_MESSAGE = "No content (empty input stream)";
69+
6670
/**
6771
* Looks like we need to worry about accidental
6872
* data binding for types we shouldn't be handling. This is
@@ -192,9 +196,6 @@ public abstract class ProviderBase<
192196
protected final LRUMap<AnnotationBundleKey, EP_CONFIG> _writers
193197
= new LRUMap<AnnotationBundleKey, EP_CONFIG>(16, 120);
194198

195-
protected final AtomicReference<IOException> _noContentExceptionRef
196-
= new AtomicReference<IOException>();
197-
198199
/*
199200
/**********************************************************
200201
/* Life-cycle
@@ -207,9 +208,8 @@ protected ProviderBase(MAPPER_CONFIG mconfig) {
207208
}
208209

209210
/**
210-
* Constructor that is only added to resolve
211-
* issue #10; problems with combination of
212-
* RESTeasy and CDI.
211+
* Constructor that is only added to resolve [jaxrs-providers#10]; problems
212+
* with combination of RESTeasy and CDI.
213213
* Should NOT be used by any code explicitly; only exists
214214
* for proxy support.
215215
*/
@@ -554,9 +554,8 @@ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotat
554554
// negation: Boolean.TRUE means untouchable -> can not write
555555
return !customUntouchable.booleanValue();
556556
}
557-
/* Ok: looks like we must weed out some core types here; ones that
558-
* make no sense to try to bind from JSON:
559-
*/
557+
// Ok: looks like we must weed out some core types here; ones that
558+
// make no sense to try to bind from JSON:
560559
if (_isIgnorableForWriting(new ClassKey(type))) {
561560
return false;
562561
}
@@ -751,9 +750,8 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
751750
// negation: Boolean.TRUE means untouchable -> can not write
752751
return !customUntouchable.booleanValue();
753752
}
754-
/* Ok: looks like we must weed out some core types here; ones that
755-
* make no sense to try to bind from JSON:
756-
*/
753+
// Ok: looks like we must weed out some core types here; ones that
754+
// make no sense to try to bind from JSON:
757755
if (_isIgnorableForReading(new ClassKey(type))) {
758756
return false;
759757
}
@@ -797,14 +795,11 @@ public Object readFrom(Class<Object> type, Type genericType, Annotation[] annota
797795
if (JaxRSFeature.ALLOW_EMPTY_INPUT.enabledIn(_jaxRSFeatures)) {
798796
return null;
799797
}
800-
/* 05-Apr-2014, tatu: Trick-ee. NoContentFoundException only available in JAX-RS 2.0...
801-
* so need bit of obfuscated code to reach it.
802-
*/
803-
IOException fail = _noContentExceptionRef.get();
804-
if (fail == null) {
805-
fail = _createNoContentException();
806-
}
807-
throw fail;
798+
// 05-Apr-2014, tatu: Trick-ee. NoContentFoundException only available in JAX-RS 2.0...
799+
// so need bit of obfuscated code to reach it.
800+
801+
// 20-Jan-2021, tatu: as per [jaxrs-providers#134], simplify
802+
throw _createNoContentException();
808803
}
809804
Class<?> rawType = type;
810805
if (rawType == JsonParser.class) {
@@ -990,13 +985,9 @@ protected boolean _isIgnorableForWriting(ClassKey typeKey)
990985
{
991986
return _untouchables.contains(typeKey);
992987
}
993-
994-
/**
995-
* @since 2.4
996-
*/
997-
protected IOException _createNoContentException()
998-
{
999-
return new NoContentException("No content (empty input stream)");
988+
989+
protected IOException _createNoContentException() {
990+
return new NoContentException(NO_CONTENT_MESSAGE);
1000991
}
1001992

1002993
/*

media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs/json/PackageVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
public final class PackageVersion implements Versioned {
1313
public final static Version VERSION = VersionUtil.parseVersion(
14-
"2.11.3", "com.fasterxml.jackson.jaxrs", "jackson-jaxrs-json-provider");
14+
"2.13.0", "com.fasterxml.jackson.jaxrs", "jackson-jaxrs-json-provider");
1515

1616
@Override
1717
public Version version() {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@
20772077
<hk2.jvnet.osgi.version>org.jvnet.hk2.*;version="[2.5,4)"</hk2.jvnet.osgi.version>
20782078
<hk2.config.version>6.0.0</hk2.config.version>
20792079
<httpclient.version>4.5.13</httpclient.version>
2080-
<jackson.version>2.12.2</jackson.version>
2080+
<jackson.version>2.13.0</jackson.version>
20812081
<javassist.version>3.25.0-GA</javassist.version>
20822082
<jboss.logging.version>3.3.0.Final</jboss.logging.version>
20832083
<jersey1.version>1.19.3</jersey1.version>

0 commit comments

Comments
 (0)