Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 1a3ec0e06 -> f4d2e7aac
Few minor optimizations already included on master Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f4d2e7aa Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f4d2e7aa Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f4d2e7aa Branch: refs/heads/3.0.x-fixes Commit: f4d2e7aaca7a496e19d6bcd152bb7513452aff94 Parents: 1a3ec0e Author: Alessio Soldano <[email protected]> Authored: Mon Jun 1 17:21:13 2015 +0200 Committer: Alessio Soldano <[email protected]> Committed: Mon Jun 1 17:21:13 2015 +0200 ---------------------------------------------------------------------- .../addressing/impl/InternalContextUtils.java | 8 +++- .../wss4j/PolicyBasedWSS4JInInterceptor.java | 49 ++++++++++++-------- 2 files changed, 35 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/f4d2e7aa/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java index cfe08c4..9d2aaaf 100644 --- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java +++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/impl/InternalContextUtils.java @@ -394,7 +394,9 @@ final class InternalContextUtils { action = getActionFromServiceModel(message, fault); } } - LOG.fine("action: " + action); + if (LOG.isLoggable(Level.FINE)) { + LOG.fine("action: " + action); + } return action != null ? ContextUtils.getAttributedURI(action) : null; } @@ -468,7 +470,9 @@ final class InternalContextUtils { } } } - LOG.fine("action determined from service model: " + action); + if (LOG.isLoggable(Level.FINE)) { + LOG.fine("action determined from service model: " + action); + } return action; } http://git-wip-us.apache.org/repos/asf/cxf/blob/f4d2e7aa/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java index d151cf5..2dd4880 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java @@ -225,17 +225,20 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { signCrypto = getSignatureCrypto(s, message, data); } + final String signCryptoRefId = signCrypto != null ? "RefId-" + signCrypto.hashCode() : null; + if (signCrypto != null) { - message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" + signCrypto.hashCode()); - message.put("RefId-" + signCrypto.hashCode(), signCrypto); + message.put(WSHandlerConstants.DEC_PROP_REF_ID, signCryptoRefId); + message.put(signCryptoRefId, signCrypto); } if (encrCrypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + encrCrypto.hashCode()); - message.put("RefId-" + encrCrypto.hashCode(), (Crypto)encrCrypto); + final String encCryptoRefId = "RefId-" + encrCrypto.hashCode(); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, encCryptoRefId); + message.put(encCryptoRefId, (Crypto)encrCrypto); } else if (signCrypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + signCrypto.hashCode()); - message.put("RefId-" + signCrypto.hashCode(), (Crypto)signCrypto); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, signCryptoRefId); + message.put(signCryptoRefId, (Crypto)signCrypto); } return action; @@ -263,17 +266,19 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { signCrypto = getSignatureCrypto(s, message, data); } + final String signCryptoRefId = signCrypto != null ? "RefId-" + signCrypto.hashCode() : null; if (signCrypto != null) { - message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" + signCrypto.hashCode()); - message.put("RefId-" + signCrypto.hashCode(), signCrypto); + message.put(WSHandlerConstants.DEC_PROP_REF_ID, signCryptoRefId); + message.put(signCryptoRefId, signCrypto); } if (encrCrypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + encrCrypto.hashCode()); - message.put("RefId-" + encrCrypto.hashCode(), (Crypto)encrCrypto); + final String encCryptoRefId = "RefId-" + encrCrypto.hashCode(); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, encCryptoRefId); + message.put(encCryptoRefId, (Crypto)encrCrypto); } else if (signCrypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + signCrypto.hashCode()); - message.put("RefId-" + signCrypto.hashCode(), (Crypto)signCrypto); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, signCryptoRefId); + message.put(signCryptoRefId, (Crypto)signCrypto); } return action; @@ -383,8 +388,9 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { crypto = signCrypto; } if (crypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + crypto.hashCode()); - message.put("RefId-" + crypto.hashCode(), crypto); + final String refId = "RefId-" + crypto.hashCode(); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, refId); + message.put(refId, crypto); } crypto = signCrypto; @@ -392,8 +398,9 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { crypto = encrCrypto; } if (crypto != null) { - message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" + crypto.hashCode()); - message.put("RefId-" + crypto.hashCode(), crypto); + final String refId = "RefId-" + crypto.hashCode(); + message.put(WSHandlerConstants.DEC_PROP_REF_ID, refId); + message.put(refId, crypto); } } else { Crypto crypto = signCrypto; @@ -401,8 +408,9 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { crypto = encrCrypto; } if (crypto != null) { - message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, "RefId-" + crypto.hashCode()); - message.put("RefId-" + crypto.hashCode(), crypto); + final String refId = "RefId-" + crypto.hashCode(); + message.put(WSHandlerConstants.SIG_VER_PROP_REF_ID, refId); + message.put(refId, crypto); } crypto = encrCrypto; @@ -410,8 +418,9 @@ public class PolicyBasedWSS4JInInterceptor extends WSS4JInInterceptor { crypto = signCrypto; } if (crypto != null) { - message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" + crypto.hashCode()); - message.put("RefId-" + crypto.hashCode(), crypto); + final String refId = "RefId-" + crypto.hashCode(); + message.put(WSHandlerConstants.DEC_PROP_REF_ID, refId); + message.put(refId, crypto); } }
