Repository: cxf Updated Branches: refs/heads/master b77bbdc44 -> f7163912b
[CXF-5572] - "EHCacheManagerHolder returning wrong CacheConfiguration" Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d33c0de1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d33c0de1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d33c0de1 Branch: refs/heads/master Commit: d33c0de10f41e860ef38793784f20172eb3df2c2 Parents: 2be0649 Author: Colm O hEigeartaigh <[email protected]> Authored: Thu Feb 20 14:02:49 2014 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Thu Feb 20 14:02:49 2014 +0000 ---------------------------------------------------------------------- .../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/d33c0de1/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 9ace9ee..c4dca26 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().hashCode(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += info.getName().toString().hashCode(); + } else { + cacheKey += "-" + info.getName().toString().hashCode(); + } } URL configFile = getConfigFileURL(message); @@ -155,7 +160,12 @@ public final class WSS4JUtils { TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance(); String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE; if (info.getName() != null) { - cacheKey += "-" + info.getName().toString().hashCode(); + int hashcode = info.getName().toString().hashCode(); + if (hashcode < 0) { + cacheKey += info.getName().toString().hashCode(); + } else { + cacheKey += "-" + info.getName().toString().hashCode(); + } } tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message); info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
