Code example for MapMaker

Methods: makeMap

0
 
    public final static String TOGGLE_PROPERTY = "org.gradle.resolution.memorycache";
 
    private final static Logger LOG = Logging.getLogger(InMemoryCachedRepositoryFactory.class); 
 
    Map<String, InMemoryModuleComponentRepositoryCaches> cachePerRepo = new MapMaker().makeMap();
 
    final InMemoryCacheStats stats = new InMemoryCacheStats();
 
    public ModuleComponentRepository cached(ModuleComponentRepository input) {
        if ("false".equalsIgnoreCase(System.getProperty(TOGGLE_PROPERTY))) {
            return input;
        } 
 
        InMemoryModuleComponentRepositoryCaches caches = cachePerRepo.get(input.getId());
        stats.reposWrapped++;
        if (caches == null) {
            LOG.debug("Creating new in-memory cache for repo '{}' [{}].", input.getName(), input.getId());
            caches = new InMemoryModuleComponentRepositoryCaches(stats);
            stats.cacheInstances++;
Contextual code suggestions in your IDE  Get Codota for Java