You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2021/06/01 17:53:11 UTC
[cxf] branch 3.4.x-fixes updated: [CXF-8546]introduce a property so
that we can configure writeOptionalTypeParameters
This is an automated email from the ASF dual-hosted git repository.
ffang pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
new 0f8d739 [CXF-8546]introduce a property so that we can configure writeOptionalTypeParameters
0f8d739 is described below
commit 0f8d739b2a4124c4892f8b45d558bdb85a19f86d
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Jun 1 13:52:20 2021 -0400
[CXF-8546]introduce a property so that we can configure writeOptionalTypeParameters
(cherry picked from commit b8cbeb5f643009f67673d5f0244225fcf1b8e372)
---
.../java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java
index e41a826..0e0b4dc 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/AttachmentOutInterceptor.java
@@ -39,10 +39,14 @@ public class AttachmentOutInterceptor extends AbstractPhaseInterceptor<Message>
public static final String WRITE_ATTACHMENTS = "write.attachments";
public static final String ATTACHMENT_OUT_CHECKED = "attachment.out.checked";
+
+ public static final String WRITE_OPTIONAL_TYPE_PARAMETERS = "write.optional.type.parameters";
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AttachmentOutInterceptor.class);
private AttachmentOutEndingInterceptor ending = new AttachmentOutEndingInterceptor();
+
+ private boolean writeOptionalTypeParameters = true;
public AttachmentOutInterceptor() {
super(Phase.PRE_STREAM);
@@ -63,6 +67,7 @@ public class AttachmentOutInterceptor extends AbstractPhaseInterceptor<Message>
boolean writeAtts = MessageUtils.getContextualBoolean(message, WRITE_ATTACHMENTS, false)
|| (message.getAttachments() != null && !message.getAttachments().isEmpty());
+ writeOptionalTypeParameters = MessageUtils.getContextualBoolean(message, WRITE_OPTIONAL_TYPE_PARAMETERS, true);
if (!mtomEnabled && !writeAtts) {
return;
}
@@ -98,7 +103,7 @@ public class AttachmentOutInterceptor extends AbstractPhaseInterceptor<Message>
}
protected boolean writeOptionalTypeParameters() {
- return true;
+ return writeOptionalTypeParameters;
}
protected Map<String, List<String>> getRootHeaders() {