Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge actual master into 3.1 #4932

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public abstract class ProviderBase<
*/
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
Expand Down Expand Up @@ -192,9 +196,6 @@ public abstract class ProviderBase<
protected final LRUMap<AnnotationBundleKey, EP_CONFIG> _writers
= new LRUMap<AnnotationBundleKey, EP_CONFIG>(16, 120);

protected final AtomicReference<IOException> _noContentExceptionRef
= new AtomicReference<IOException>();

/*
/**********************************************************
/* Life-cycle
Expand All @@ -207,9 +208,8 @@ protected ProviderBase(MAPPER_CONFIG mconfig) {
}

/**
* 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.
*/
Expand Down Expand Up @@ -554,9 +554,8 @@ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotat
// 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;
}
Expand Down Expand Up @@ -751,9 +750,8 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
// 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;
}
Expand Down Expand Up @@ -797,14 +795,11 @@ public Object readFrom(Class<Object> type, Type genericType, Annotation[] annota
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) {
Expand Down Expand Up @@ -990,13 +985,9 @@ protected boolean _isIgnorableForWriting(ClassKey typeKey)
{
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);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,7 @@
<hk2.jvnet.osgi.version>org.jvnet.hk2.*;version="[2.5,4)"</hk2.jvnet.osgi.version>
<hk2.config.version>6.0.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>
<javassist.version>3.25.0-GA</javassist.version>
<jboss.logging.version>3.3.0.Final</jboss.logging.version>
<jersey1.version>1.19.3</jersey1.version>
Expand Down