Repository: cxf Updated Branches: refs/heads/master 1fe6ef5fa -> a1710bdd7
[CXF-6738] Minor refactoring Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a1710bdd Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a1710bdd Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a1710bdd Branch: refs/heads/master Commit: a1710bdd783afcd667d9e72ccb031480d3806850 Parents: 8e650cf Author: Alessio Soldano <asold...@redhat.com> Authored: Tue Jan 26 23:52:22 2016 +0100 Committer: Alessio Soldano <asold...@redhat.com> Committed: Wed Jan 27 13:48:12 2016 +0100 ---------------------------------------------------------------------- .../apache/cxf/ws/policy/PolicyEngineImpl.java | 38 ++++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a1710bdd/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java ---------------------------------------------------------------------- diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java index e3af4c9..6155a38 100644 --- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java +++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java @@ -313,18 +313,7 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension { boolean isRequestor, Assertor assertor, Message m) { - EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor - ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER); - if (ep == null) { - synchronized (ei) { - ep = (EndpointPolicy)ei.getProperty(isRequestor - ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER); - if (ep == null) { - ep = createEndpointPolicyInfo(ei, isRequestor, assertor, m); - } - } - } - return ep; + return createEndpointPolicyInfo(ei, isRequestor, assertor, m); } public void setClientEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) { @@ -600,16 +589,27 @@ public class PolicyEngineImpl implements PolicyEngine, BusExtension { return vocabulary; } - EndpointPolicyImpl createEndpointPolicyInfo(EndpointInfo ei, - boolean isRequestor, + EndpointPolicy createEndpointPolicyInfo(EndpointInfo ei, + boolean isRequestor, Assertor assertor, Message m) { - EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor, assertor); - epi.initialize(m); - if (m != null) { - ei.setProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER, epi); + EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor + ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER); + if (ep == null) { + synchronized (ei) { + ep = (EndpointPolicy)ei.getProperty(isRequestor + ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER); + if (ep == null) { + EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor, assertor); + epi.initialize(m); + if (m != null) { + ei.setProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER, epi); + } + ep = epi; + } + } } - return epi; + return ep; }