diff --git a/scm-core/src/main/java/sonia/scm/cache/CacheManager.java b/scm-core/src/main/java/sonia/scm/cache/CacheManager.java index 8cbdfc50ac..235fa4e2ac 100644 --- a/scm-core/src/main/java/sonia/scm/cache/CacheManager.java +++ b/scm-core/src/main/java/sonia/scm/cache/CacheManager.java @@ -51,14 +51,11 @@ public interface CacheManager extends Closeable * Returns the cache with the specified types and name. * If the cache does not exist, a new cache is created. * - * - * @param key - The type of the keys for the cache - * @param value - The type of cache elements * @param name - The name of the cache * @param - The type of the keys for the cache * @param - The type of cache elements * * @return the cache with the specified types and name */ - public Cache getCache(Class key, Class value, String name); + public Cache getCache(String name); } diff --git a/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHookEvent.java b/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHookEvent.java index af271876ba..3207c17933 100644 --- a/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHookEvent.java +++ b/scm-core/src/main/java/sonia/scm/repository/PreReceiveRepositoryHookEvent.java @@ -41,14 +41,13 @@ import sonia.scm.event.Event; * Pre receive repository hook events are fired before a change is written * through the repository. This class is wrapper of {@link RepositoryHookEvent} * for the event system of SCM-Manager. - * - * TODO: make final for version 2.0 * * @author Sebastian Sdorra * @since 1.23 */ @Event -public class PreReceiveRepositoryHookEvent extends WrappedRepositoryHookEvent +public final class PreReceiveRepositoryHookEvent + extends WrappedRepositoryHookEvent { /** diff --git a/scm-core/src/main/java/sonia/scm/repository/api/BlameCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/BlameCommandBuilder.java index f57ca6ab39..203a01b331 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/BlameCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/BlameCommandBuilder.java @@ -105,8 +105,7 @@ public final class BlameCommandBuilder BlameCommandBuilder(CacheManager cacheManager, BlameCommand blameCommand, Repository repository, PreProcessorUtil preProcessorUtil) { - this.cache = cacheManager.getCache(CacheKey.class, BlameResult.class, - CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.blameCommand = blameCommand; this.repository = repository; this.preProcessorUtil = preProcessorUtil; @@ -151,7 +150,7 @@ public final class BlameCommandBuilder requestClone.setPath(path); - BlameResult result = null; + BlameResult result; if (disableCache) { @@ -351,21 +350,21 @@ public final class BlameCommandBuilder //~--- fields ------------------------------------------------------------- - /** Field description */ - private String repositoryId; + /** repository id */ + private final String repositoryId; - /** Field description */ - private BlameCommandRequest request; + /** request object */ + private final BlameCommandRequest request; } //~--- fields --------------------------------------------------------------- /** implementation of the blame command */ - private BlameCommand blameCommand; + private final BlameCommand blameCommand; /** the cache */ - private Cache cache; + private final Cache cache; /** disable escaping */ private boolean disableEscaping = false; @@ -377,11 +376,11 @@ public final class BlameCommandBuilder private boolean disablePreProcessors = false; /** Field description */ - private PreProcessorUtil preProcessorUtil; + private final PreProcessorUtil preProcessorUtil; /** the repository */ - private Repository repository; + private final Repository repository; /** request for the blame command implementation */ - private BlameCommandRequest request = new BlameCommandRequest(); + private final BlameCommandRequest request = new BlameCommandRequest(); } diff --git a/scm-core/src/main/java/sonia/scm/repository/api/BranchesCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/BranchesCommandBuilder.java index a375c6b9b8..3deaf491d8 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/BranchesCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/BranchesCommandBuilder.java @@ -94,8 +94,7 @@ public final class BranchesCommandBuilder BranchesCommandBuilder(CacheManager cacheManager, BranchesCommand branchesCommand, Repository repository) { - this.cache = cacheManager.getCache(CacheKey.class, Branches.class, - CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.branchesCommand = branchesCommand; this.repository = repository; } @@ -113,7 +112,7 @@ public final class BranchesCommandBuilder */ public Branches getBranches() throws RepositoryException, IOException { - Branches branches = null; + Branches branches; if (disableCache) { @@ -270,22 +269,22 @@ public final class BranchesCommandBuilder //~--- fields ------------------------------------------------------------- - /** Field description */ - private String repositoryId; + /** repository id */ + private final String repositoryId; } //~--- fields --------------------------------------------------------------- /** branches command implementation */ - private BranchesCommand branchesCommand; + private final BranchesCommand branchesCommand; /** cache for branches */ - private Cache cache; + private final Cache cache; /** disable cache */ private boolean disableCache = false; /** repository */ - private Repository repository; + private final Repository repository; } diff --git a/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java index ea4c1450ae..655b7d4816 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/BrowseCommandBuilder.java @@ -108,8 +108,7 @@ public final class BrowseCommandBuilder BrowseCommandBuilder(CacheManager cacheManager, BrowseCommand browseCommand, Repository repository, PreProcessorUtil preProcessorUtil) { - this.cache = cacheManager.getCache(CacheKey.class, BrowserResult.class, - CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.browseCommand = browseCommand; this.repository = repository; this.preProcessorUtil = preProcessorUtil; @@ -424,21 +423,21 @@ public final class BrowseCommandBuilder //~--- fields ------------------------------------------------------------- - /** Field description */ - private String repositoryId; + /** repository id */ + private final String repositoryId; - /** Field description */ - private BrowseCommandRequest request; + /** request object */ + private final BrowseCommandRequest request; } //~--- fields --------------------------------------------------------------- /** implementation of the browse command */ - private BrowseCommand browseCommand; + private final BrowseCommand browseCommand; /** cache */ - private Cache cache; + private final Cache cache; /** disable escaping */ private boolean disableEscaping = false; @@ -450,11 +449,11 @@ public final class BrowseCommandBuilder private boolean disablePreProcessors = false; /** Field description */ - private PreProcessorUtil preProcessorUtil; + private final PreProcessorUtil preProcessorUtil; /** the repsitory */ - private Repository repository; + private final Repository repository; /** request for the command */ - private BrowseCommandRequest request = new BrowseCommandRequest(); + private final BrowseCommandRequest request = new BrowseCommandRequest(); } diff --git a/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java index 2977979ad2..de5e2b1b9f 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/LogCommandBuilder.java @@ -116,8 +116,7 @@ public final class LogCommandBuilder LogCommandBuilder(CacheManager cacheManager, LogCommand logCommand, Repository repository, PreProcessorUtil preProcessorUtil) { - this.cache = cacheManager.getCache(CacheKey.class, - ChangesetPagingResult.class, CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.logCommand = logCommand; this.repository = repository; this.preProcessorUtil = preProcessorUtil; @@ -172,7 +171,7 @@ public final class LogCommandBuilder public Changeset getChangeset(String id) throws IOException, RepositoryException { - Changeset changeset = null; + Changeset changeset; if (disableCache) { @@ -234,7 +233,7 @@ public final class LogCommandBuilder public ChangesetPagingResult getChangesets() throws IOException, RepositoryException { - ChangesetPagingResult cpr = null; + ChangesetPagingResult cpr; if (disableCache) { @@ -453,6 +452,7 @@ public final class LogCommandBuilder { this.repositoryId = repository.getId(); this.request = request; + this.changesetId = null; } /** @@ -467,6 +467,7 @@ public final class LogCommandBuilder { this.repositoryId = repository.getId(); this.changesetId = changesetId; + this.request = null; } //~--- methods ------------------------------------------------------------ @@ -528,20 +529,29 @@ public final class LogCommandBuilder //~--- fields ------------------------------------------------------------- /** Field description */ - private String changesetId; + private final String changesetId; /** Field description */ - private String repositoryId; + private final String repositoryId; /** Field description */ - private LogCommandRequest request; + private final LogCommandRequest request; } //~--- fields --------------------------------------------------------------- /** cache for changesets */ - private Cache cache; + private final Cache cache; + + /** Implementation of the log command */ + private final LogCommand logCommand; + + /** Field description */ + private final PreProcessorUtil preProcessorUtil; + + /** repository to query */ + private final Repository repository; /** disable escaping */ private boolean disableEscaping = false; @@ -552,15 +562,6 @@ public final class LogCommandBuilder /** disable the execution of pre processors */ private boolean disablePreProcessors = false; - /** Implementation of the log command */ - private LogCommand logCommand; - - /** Field description */ - private PreProcessorUtil preProcessorUtil; - - /** repository to query */ - private Repository repository; - /** request for the log command */ - private LogCommandRequest request = new LogCommandRequest(); + private final LogCommandRequest request = new LogCommandRequest(); } diff --git a/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java b/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java index 240b3e25cd..23543d0719 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/RepositoryServiceFactory.java @@ -307,19 +307,11 @@ public final class RepositoryServiceFactory */ public CacheClearHook(CacheManager cacheManager) { - this.blameCache = - cacheManager.getCache(BlameCommandBuilder.CacheKey.class, - BlameResult.class, BlameCommandBuilder.CACHE_NAME); - this.browseCache = - cacheManager.getCache(BrowseCommandBuilder.CacheKey.class, - BrowserResult.class, BrowseCommandBuilder.CACHE_NAME); - this.logCache = cacheManager.getCache(LogCommandBuilder.CacheKey.class, - ChangesetPagingResult.class, LogCommandBuilder.CACHE_NAME); - this.tagsCache = cacheManager.getCache(TagsCommandBuilder.CacheKey.class, - Tags.class, TagsCommandBuilder.CACHE_NAME); - this.branchesCache = - cacheManager.getCache(BranchesCommandBuilder.CacheKey.class, - Branches.class, BranchesCommandBuilder.CACHE_NAME); + this.blameCache = cacheManager.getCache(BlameCommandBuilder.CACHE_NAME); + this.browseCache = cacheManager.getCache(BrowseCommandBuilder.CACHE_NAME); + this.logCache = cacheManager.getCache(LogCommandBuilder.CACHE_NAME); + this.tagsCache = cacheManager.getCache(TagsCommandBuilder.CACHE_NAME); + this.branchesCache =cacheManager.getCache(BranchesCommandBuilder.CACHE_NAME); } //~--- methods ------------------------------------------------------------ diff --git a/scm-core/src/main/java/sonia/scm/repository/api/TagsCommandBuilder.java b/scm-core/src/main/java/sonia/scm/repository/api/TagsCommandBuilder.java index 3144114ff7..65ceef0828 100644 --- a/scm-core/src/main/java/sonia/scm/repository/api/TagsCommandBuilder.java +++ b/scm-core/src/main/java/sonia/scm/repository/api/TagsCommandBuilder.java @@ -30,6 +30,7 @@ */ + package sonia.scm.repository.api; //~--- non-JDK imports -------------------------------------------------------- @@ -94,7 +95,7 @@ public final class TagsCommandBuilder TagsCommandBuilder(CacheManager cacheManager, TagsCommand command, Repository repository) { - this.cache = cacheManager.getCache(CacheKey.class, Tags.class, CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.command = command; this.repository = repository; } @@ -112,7 +113,7 @@ public final class TagsCommandBuilder */ public Tags getTags() throws RepositoryException, IOException { - Tags tags = null; + Tags tags; if (disableCache) { @@ -270,22 +271,22 @@ public final class TagsCommandBuilder //~--- fields ------------------------------------------------------------- - /** Field description */ - private String repositoryId; + /** repository id */ + private final String repositoryId; } //~--- fields --------------------------------------------------------------- /** cache for changesets */ - private Cache cache; + private final Cache cache; - /** Field description */ - private TagsCommand command; + /** command implementation */ + private final TagsCommand command; - /** Field description */ + /** repository */ + private final Repository repository; + + /** disable cache */ private boolean disableCache = false; - - /** Field description */ - private Repository repository; } diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/HgPackageReader.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/HgPackageReader.java index b4ee9cc2c9..67b988e336 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/HgPackageReader.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/HgPackageReader.java @@ -91,7 +91,7 @@ public class HgPackageReader public HgPackageReader(CacheManager cacheManager, Provider httpClientProvider) { - cache = cacheManager.getCache(String.class, HgPackages.class, CACHENAME); + cache = cacheManager.getCache(CACHENAME); this.httpClientProvider = httpClientProvider; } @@ -248,8 +248,8 @@ public class HgPackageReader //~--- fields --------------------------------------------------------------- /** Field description */ - private Cache cache; + private final Cache cache; /** Field description */ - private Provider httpClientProvider; + private final Provider httpClientProvider; } diff --git a/scm-test/src/main/java/sonia/scm/cache/MapCacheManager.java b/scm-test/src/main/java/sonia/scm/cache/MapCacheManager.java index afc4580f99..036701122e 100644 --- a/scm-test/src/main/java/sonia/scm/cache/MapCacheManager.java +++ b/scm-test/src/main/java/sonia/scm/cache/MapCacheManager.java @@ -70,8 +70,6 @@ public class MapCacheManager implements CacheManager * Method description * * - * @param key - * @param value * @param name * @param * @param @@ -79,103 +77,22 @@ public class MapCacheManager implements CacheManager * @return */ @Override - public Cache getCache(Class key, Class value, String name) + public Cache getCache(String name) { - CacheKey cacheKey = new CacheKey(key, value, name); - Cache cache = cacheMap.get(cacheKey); + Cache cache = cacheMap.get(name); if (cache == null) { cache = new MapCache(); - cacheMap.put(cacheKey, cache); + cacheMap.put(name, cache); } return cache; } - //~--- inner classes -------------------------------------------------------- - - /** - * Class description - * - * - * @version Enter version here..., 12/06/24 - * @author Enter your name here... - */ - private static class CacheKey - { - - /** - * Constructs ... - * - * - * @param key - * @param value - * @param name - */ - public CacheKey(Class key, Class value, String name) - { - this.key = key; - this.value = value; - this.name = name; - } - - //~--- methods ------------------------------------------------------------ - - /** - * Method description - * - * - * @param obj - * - * @return - */ - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - - if (getClass() != obj.getClass()) - { - return false; - } - - final CacheKey other = (CacheKey) obj; - - return Objects.equal(key, other.key) && Objects.equal(value, other.value) - && Objects.equal(name, other.name); - } - - /** - * Method description - * - * - * @return - */ - @Override - public int hashCode() - { - return Objects.hashCode(key, value, name); - } - - //~--- fields ------------------------------------------------------------- - - /** Field description */ - private Class key; - - /** Field description */ - private String name; - - /** Field description */ - private Class value; - } - //~--- fields --------------------------------------------------------------- /** Field description */ - private Map cacheMap = Maps.newHashMap(); + private final Map cacheMap = Maps.newHashMap(); } diff --git a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/SearchResource.java b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/SearchResource.java index 03c3854bae..afadc513c2 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/rest/resources/SearchResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/rest/resources/SearchResource.java @@ -36,6 +36,7 @@ package sonia.scm.api.rest.resources; //~--- non-JDK imports -------------------------------------------------------- import com.github.legman.Subscribe; + import com.google.common.base.Function; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -45,11 +46,13 @@ import org.codehaus.enunciate.modules.jersey.ExternallyManagedLifecycle; import sonia.scm.cache.Cache; import sonia.scm.cache.CacheManager; import sonia.scm.group.Group; +import sonia.scm.group.GroupEvent; import sonia.scm.group.GroupManager; import sonia.scm.search.SearchHandler; import sonia.scm.search.SearchResult; import sonia.scm.search.SearchResults; import sonia.scm.user.User; +import sonia.scm.user.UserEvent; import sonia.scm.user.UserManager; //~--- JDK imports ------------------------------------------------------------ @@ -59,8 +62,6 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; -import sonia.scm.group.GroupEvent; -import sonia.scm.user.UserEvent; /** * @@ -94,14 +95,13 @@ public class SearchResource { // create user searchhandler - Cache userCache = - cacheManager.getCache(String.class, SearchResults.class, CACHE_USER); + Cache userCache = cacheManager.getCache(CACHE_USER); this.userSearchHandler = new SearchHandler(userCache, userManager); // create group searchhandler Cache groupCache = - cacheManager.getCache(String.class, SearchResults.class, CACHE_GROUP); + cacheManager.getCache(CACHE_GROUP); this.groupSearchHandler = new SearchHandler(groupCache, groupManager); @@ -118,7 +118,8 @@ public class SearchResource @Subscribe public void onEvent(UserEvent event) { - if ( event.getEventType().isPost() ){ + if (event.getEventType().isPost()) + { userSearchHandler.clearCache(); } } @@ -132,7 +133,8 @@ public class SearchResource @Subscribe public void onEvent(GroupEvent event) { - if ( event.getEventType().isPost() ){ + if (event.getEventType().isPost()) + { groupSearchHandler.clearCache(); } } diff --git a/scm-webapp/src/main/java/sonia/scm/cache/GuavaCacheManager.java b/scm-webapp/src/main/java/sonia/scm/cache/GuavaCacheManager.java index 87fe2d9d15..a40c1ed7e7 100644 --- a/scm-webapp/src/main/java/sonia/scm/cache/GuavaCacheManager.java +++ b/scm-webapp/src/main/java/sonia/scm/cache/GuavaCacheManager.java @@ -118,8 +118,6 @@ public class GuavaCacheManager implements CacheManager * Method description * * - * @param key - * @param value * @param name * @param * @param @@ -127,8 +125,7 @@ public class GuavaCacheManager implements CacheManager * @return */ @Override - public synchronized GuavaCache getCache(Class key, - Class value, String name) + public synchronized GuavaCache getCache(String name) { logger.trace("try to retrieve cache {}", name); diff --git a/scm-webapp/src/main/java/sonia/scm/plugin/DefaultPluginManager.java b/scm-webapp/src/main/java/sonia/scm/plugin/DefaultPluginManager.java index f1cdd688b6..94ef21fd3c 100644 --- a/scm-webapp/src/main/java/sonia/scm/plugin/DefaultPluginManager.java +++ b/scm-webapp/src/main/java/sonia/scm/plugin/DefaultPluginManager.java @@ -130,8 +130,7 @@ public class DefaultPluginManager implements PluginManager { this.context = context; this.configuration = configuration; - this.cache = cacheManager.getCache(String.class, PluginCenter.class, - CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.clientProvider = clientProvider; installedPlugins = new HashMap(); diff --git a/scm-webapp/src/main/java/sonia/scm/security/AuthorizationCollector.java b/scm-webapp/src/main/java/sonia/scm/security/AuthorizationCollector.java index 9ec6814062..a5eab68b11 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/AuthorizationCollector.java +++ b/scm-webapp/src/main/java/sonia/scm/security/AuthorizationCollector.java @@ -106,8 +106,7 @@ public class AuthorizationCollector RepositoryDAO repositoryDAO, SecuritySystem securitySystem, PermissionResolver resolver) { - this.cache = cacheManager.getCache(CacheKey.class, AuthorizationInfo.class, - CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); this.repositoryDAO = repositoryDAO; this.securitySystem = securitySystem; this.resolver = resolver; @@ -524,15 +523,15 @@ public class AuthorizationCollector //~--- fields --------------------------------------------------------------- - /** Field description */ - private Cache cache; + /** authorization cache */ + private final Cache cache; - /** Field description */ - private RepositoryDAO repositoryDAO; + /** repository dao */ + private final RepositoryDAO repositoryDAO; - /** Field description */ - private PermissionResolver resolver; + /** permission resolver */ + private final PermissionResolver resolver; - /** Field description */ - private SecuritySystem securitySystem; + /** security system */ + private final SecuritySystem securitySystem; } diff --git a/scm-webapp/src/main/java/sonia/scm/web/security/ChainAuthenticatonManager.java b/scm-webapp/src/main/java/sonia/scm/web/security/ChainAuthenticatonManager.java index 70a171a1e7..ff1310f22e 100644 --- a/scm-webapp/src/main/java/sonia/scm/web/security/ChainAuthenticatonManager.java +++ b/scm-webapp/src/main/java/sonia/scm/web/security/ChainAuthenticatonManager.java @@ -100,8 +100,7 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager AssertUtil.assertIsNotNull(cacheManager); this.authenticationHandlers = sort(userManager, authenticationHandlerSet); this.encryptionHandler = encryptionHandler; - this.cache = cacheManager.getCache(String.class, - AuthenticationCacheValue.class, CACHE_NAME); + this.cache = cacheManager.getCache(CACHE_NAME); } //~--- methods -------------------------------------------------------------- @@ -368,12 +367,12 @@ public class ChainAuthenticatonManager extends AbstractAuthenticationManager //~--- fields --------------------------------------------------------------- - /** Field description */ - private List authenticationHandlers; + /** authentication handlers */ + private final List authenticationHandlers; - /** Field description */ - private Cache cache; + /** authentication cache */ + private final Cache cache; - /** Field description */ - private EncryptionHandler encryptionHandler; + /** encryption handler */ + private final EncryptionHandler encryptionHandler; } diff --git a/scm-webapp/src/test/java/sonia/scm/cache/CacheManagerTestBase.java b/scm-webapp/src/test/java/sonia/scm/cache/CacheManagerTestBase.java index d2290c8143..65826b7cee 100644 --- a/scm-webapp/src/test/java/sonia/scm/cache/CacheManagerTestBase.java +++ b/scm-webapp/src/test/java/sonia/scm/cache/CacheManagerTestBase.java @@ -89,10 +89,8 @@ public abstract class CacheManagerTestBase @Test public void testSameReference() { - Cache c1 = cacheManager.getCache(String.class, - String.class, "test-1"); - Cache c2 = cacheManager.getCache(String.class, - String.class, "test-1"); + Cache c1 = cacheManager.getCache("test-1"); + Cache c2 = cacheManager.getCache("test-1"); assertIsSame(c1, c2); } @@ -203,16 +201,16 @@ public abstract class CacheManagerTestBase @Override public Cache call() throws Exception { - return cacheManager.getCache(String.class, String.class, name); + return cacheManager.getCache(name); } //~--- fields ------------------------------------------------------------- /** Field description */ - private CacheManager cacheManager; + private final CacheManager cacheManager; /** Field description */ - private String name; + private final String name; } diff --git a/scm-webapp/src/test/java/sonia/scm/cache/CacheTestBase.java b/scm-webapp/src/test/java/sonia/scm/cache/CacheTestBase.java index 7c19f7c18b..45d646f7f7 100644 --- a/scm-webapp/src/test/java/sonia/scm/cache/CacheTestBase.java +++ b/scm-webapp/src/test/java/sonia/scm/cache/CacheTestBase.java @@ -76,7 +76,7 @@ public abstract class CacheTestBase public void before() { cm = createCacheManager(); - cache = cm.getCache(String.class, String.class, "test"); + cache = cm.getCache("test"); } /**