From 33da2371db259070620a3b2a6bdbc708c6787627 Mon Sep 17 00:00:00 2001 From: jansupol Date: Wed, 6 Oct 2021 20:38:21 +0200 Subject: [PATCH 1/2] Make a change of default behaviour of UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE property Signed-off-by: jansupol --- .../jersey/server/ServerProperties.java | 2 +- .../server/model/ResourceMethodInvoker.java | 2 +- docs/src/main/docbook/appendix-properties.xml | 13 ++++++- docs/src/main/docbook/jersey.ent | 1 + docs/src/main/docbook/migration.xml | 36 ++++++++++++++++--- 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java b/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java index 2a2aa5be54..dc176255a2 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/ServerProperties.java @@ -750,7 +750,7 @@ public final class ServerProperties { * The {@code CompletionStage} value will be unwrapped and the message body writer will be invoked with the unwrapped type. * *

- * The default value is {@code false}. + * The default value is {@code true}. *

*

* The name of the configuration property is {@value}. diff --git a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java index 4b5b882e85..94599f2450 100644 --- a/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java +++ b/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java @@ -486,7 +486,7 @@ private Response invoke(final RequestProcessingContext context, final Object res private Type unwrapInvocableResponseType(ContainerRequest request) { if (isCompletionStageResponseType - && request.resolveProperty(ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE, Boolean.FALSE)) { + && request.resolveProperty(ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE, Boolean.TRUE)) { return completionStageResponseType; } return invocableResponseType; diff --git a/docs/src/main/docbook/appendix-properties.xml b/docs/src/main/docbook/appendix-properties.xml index 17e5a241b7..0e33a385c9 100644 --- a/docs/src/main/docbook/appendix-properties.xml +++ b/docs/src/main/docbook/appendix-properties.xml @@ -1,7 +1,7 @@