Repository: cxf Updated Branches: refs/heads/master cf0575568 -> 779cf32e4
[CXF-5766] - Caching nonces to disk may not work if the service QName is too long Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/779cf32e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/779cf32e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/779cf32e Branch: refs/heads/master Commit: 779cf32e40fbe53f9ef1726a973512a07925b681 Parents: cf05755 Author: Colm O hEigeartaigh <[email protected]> Authored: Mon May 26 17:07:17 2014 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon May 26 17:07:17 2014 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/ws/security/wss4j/WSS4JUtils.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/779cf32e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java index add1bb6..7ed5886 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java @@ -92,7 +92,12 @@ public final class WSS4JUtils { if (replayCache == null) { String cacheKey = instanceKey; if (info.getName() != null) { - cacheKey += "-" + info.getName().toString(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += hashcode; + } else { + cacheKey += "-" + hashcode; + } } URL configFile = getConfigFileURL(message); @@ -159,7 +164,12 @@ public final class WSS4JUtils { if (cacheIdentifier != null) { cacheKey += "-" + cacheIdentifier; } else if (info.getName() != null) { - cacheKey += "-" + info.getName().toString(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += hashcode; + } else { + cacheKey += "-" + hashcode; + } } tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message); info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
