You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "zhaohuihua (JIRA)" <ji...@apache.org> on 2018/02/07 16:21:01 UTC

[jira] [Created] (SHIRO-644) EhCacheManager.getCache Error Cache cacheName already exists

zhaohuihua created SHIRO-644:
--------------------------------

             Summary: EhCacheManager.getCache Error Cache cacheName already exists
                 Key: SHIRO-644
                 URL: https://issues.apache.org/jira/browse/SHIRO-644
             Project: Shiro
          Issue Type: Bug
          Components: Caching 
    Affects Versions: 1.4.0-RC2, 1.4.0
            Reporter: zhaohuihua


1.4.0-RC2 EhCacheManager.java line 155~172

 
net.sf.ehcache.Ehcache cache = ensureCacheManager().getEhcache(name);
if (cache == null) {
    {color:#FF0000}synchronized (name.intern()) {color}{
        cache = manager.getCache(name);
        if (cache == null) {
            if (log.isInfoEnabled()) {
                log.info("Cache with name '{}' does not yet exist.  Creating now.", name);
            }
            this.manager.addCache(name);
 
            cache = manager.getCache(name);
 
            if (log.isInfoEnabled()) {
                log.info("Added EhCache named [" + name + "]");
            }
        }
    }
} else {
    if (log.isInfoEnabled()) {
        log.info("Using existing EHCache named [" + cache.getName() + "]");
    }}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)