From 26bf5ae5a42ca488221b53d480a706421f0bcf96 Mon Sep 17 00:00:00 2001 From: Berksan Ates Date: Thu, 24 Mar 2022 13:27:55 -0500 Subject: [PATCH] Liberty change added --- .../cxf/jaxws/interceptors/SwAOutInterceptor.java | 15 ++++++++------- .../apache/cxf/ws/policy/PolicyEngineImpl.java | 6 ++++-- .../policy/PolicyVerificationInInterceptor.java | 6 ++++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxws.3.2/src/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxws.3.2/src/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java index ce6a0ffc2be7..29829b79c135 100644 --- a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxws.3.2/src/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java +++ b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxws.3.2/src/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java @@ -85,7 +85,7 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor { private static final Set SWA_REF_NO_METHOD = Collections.newSetFromMap(new ConcurrentHashMap(4, 0.75f, 2)); -// Begin copied over from CXF 2.6.2 +// Liberty change begin migration of behaviour from CXF 2.6.2 private static boolean skipHasSwaRef; static { @@ -101,7 +101,7 @@ public class SwAOutInterceptor extends AbstractSoapInterceptor { skipHasSwaRef = false; } - }// End copied over from CXF 2.6.2 + }// Liberty change end AttachmentOutInterceptor attachOut = new AttachmentOutInterceptor(); @@ -162,13 +162,13 @@ public void handleMessage(SoapMessage message) throws Fault { if (bmi == null) { return; } -// Begin copied over from CXF 2.6.2 +// Liberty change begin migration of behaviour from CXF 2.6.2 Boolean newAttachment = false; Message exOutMsg = ex.getOutMessage(); if (exOutMsg != null) { newAttachment = MessageUtils.isTrue(exOutMsg.getContextualProperty("cxf.add.attachments")); LOG.log(Level.FINE, "Request context attachment property: cxf.add.attachments is set to: " + newAttachment); - } // End copied over from CXF 2.6.2 + } // Liberty change end SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class); @@ -177,6 +177,7 @@ public void handleMessage(SoapMessage message) throws Fault { DataBinding db = s.getDataBinding(); if (db instanceof JAXBDataBinding && hasSwaRef((JAXBDataBinding) db)) { + // Liberty change begin migration of behaviour from CXF 2.6.2 Boolean includeAttachs = false; Message exInpMsg = ex.getInMessage(); LOG.log(Level.FINE, "Exchange Input message: " + exInpMsg); @@ -188,7 +189,7 @@ && hasSwaRef((JAXBDataBinding) db)) { setupAttachmentOutput(message); } else { skipAttachmentOutput(message); - } + } // Liberty change end } return; } @@ -366,7 +367,7 @@ private Collection setupAttachmentOutput(SoapMessage message) { return atts; } -// Begin copied over from CXF 2.6.2 +// Liberty change begin migration of behaviour from CXF 2.6.2 private Collection skipAttachmentOutput(SoapMessage message) { Collection atts = message.getAttachments(); @@ -384,5 +385,5 @@ private Collection skipAttachmentOutput(SoapMessage message) { } return atts; - }// End copied over from CXF 2.6.2 + }// Liberty change end } diff --git a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyEngineImpl.java b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyEngineImpl.java index b1bf99cb7660..1daa04c1f135 100644 --- a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyEngineImpl.java +++ b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyEngineImpl.java @@ -80,6 +80,7 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension { private boolean addedBusInterceptors; private AlternativeSelector alternativeSelector; + // Liberty change begin migration of behaviour from CXF 2.6.2 private static boolean ignoreUnsupportedPolicy; static { @@ -94,7 +95,7 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension { } else { ignoreUnsupportedPolicy = false; } - } + } // Liberty change end public PolicyEngineImpl() { @@ -666,13 +667,14 @@ public boolean supportsAlternative(Collection alterna if (s.isEmpty()) { if (doLog) { LOG.fine("Alternative " + a.getName() + " is not supported"); + // Liberty change begin migration of behaviour from CXF 2.6.2 if (ignoreUnsupportedPolicy) { LOG.fine("WARNING: Unsupported policy assertions will be ignored because " + "property cxf.ignore.unsupported.policy is set to true."); return true; } else { return false; - } + } // Liberty change end } return false; } diff --git a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java index 1715937f02e2..475a83a1029b 100644 --- a/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java +++ b/dev/com.ibm.ws.org.apache.cxf.cxf.rt.ws.policy.3.2/src/org/apache/cxf/ws/policy/PolicyVerificationInInterceptor.java @@ -45,6 +45,7 @@ public class PolicyVerificationInInterceptor extends AbstractPolicyInterceptor { private static final Logger LOG = LogUtils.getL7dLogger(PolicyVerificationInInterceptor.class); + // Liberty change begin migration of behaviour from CXF 2.6.2 private static boolean ignoreUnsupportedPolicy; static { @@ -57,7 +58,7 @@ public class PolicyVerificationInInterceptor extends AbstractPolicyInterceptor { && skipPolicyCheck.trim().equalsIgnoreCase("true")) { ignoreUnsupportedPolicy = true; } - } + }// Liberty change end public PolicyVerificationInInterceptor() { super(Phase.PRE_INVOKE); @@ -113,6 +114,7 @@ protected void handle(Message message) { } } try { + // Liberty change begin migration of behaviour from CXF 2.6.2 List> usedAlternatives = null; if (ignoreUnsupportedPolicy) { @@ -120,7 +122,7 @@ protected void handle(Message message) { + "property cxf.ignore.unsupported.policy is set to true."); } else { usedAlternatives = aim.checkEffectivePolicy(effectivePolicy.getPolicy()); - } + }// Liberty change end if (usedAlternatives != null && !usedAlternatives.isEmpty() && message.getExchange() != null) { message.getExchange().put("ws-policy.validated.alternatives", usedAlternatives);