Create a new cache map. This is the internal map that is used to store the
items.

@return Never <code>null</code>.
422724
@Nonnull
  @ReturnsMutableCopy
  @OverrideOnDemand
  @CodingStyleguideUnaware
  protected ICommonsMap <KEYTYPE, VALUETYPE> createCache ()
  {
    return hasMaxSize () ? new SoftLinkedHashMap <> (m_nMaxSize) : new SoftHashMap <> ();
  }
346557
public static <K,V> Storage<K,V> createHashtableStorage(){
		return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>()));
	}
758106
@Override
    public Map<String, String> getCopyOfContextMap() {
        Map<String, String> oldMap = inheritableThreadLocal.get();
        if (oldMap != null) {
            return new HashMap<>(oldMap);
        } else {
            return null;
        }
    }
588810
@Override
    public Cache getCache(String cacheName) throws CacheException
    {
        if (this.cache == null)
        {
            this.cache = createCache(cacheName);
        }

        return this.cache;
    }
689036
private Map<String, Factory> getVisibleIDMap() {
        synchronized (this) { // or idcache-only lock?
            if (idcache == null) {
                try {
                    factoryLock.acquireRead();
                    Map<String, Factory> mutableMap = new HashMap<String, Factory>();
                    ListIterator<Factory> lIter = factories.listIterator(factories.size());
                    while (lIter.hasPrevious()) {
                        Factory f = lIter.previous();
                        f.updateVisibleIDs(mutableMap);
                    }
                    this.idcache = Collections.unmodifiableMap(mutableMap);
                } finally {
                    factoryLock.releaseRead();
                }
            }
        }
        return idcache;
    }
993952
public synchronized static JsonMapper nonEmptyMapper() {
        if (nonEmptyJsonMapper == null) {
            nonEmptyJsonMapper = new JsonMapper(JsonInclude.Include.NON_EMPTY, false);
        }
        return nonEmptyJsonMapper;
    }
872705
@SuppressWarnings("unchecked")
	private Map<String, String> loadOrCreateCache(String projectName, String projectVersion) {
		if (projectName != null && projectVersion != null) {
			// Get the project dir or create it
			File projectDir = new File(getCacheDir(), projectName);
			if (!projectDir.exists()) {
				projectDir.mkdir();
			}
			
			// Get the version file or create it
			File versionFile = new File(projectDir, projectVersion);
			if (versionFile.exists()) {
				ObjectInputStream ois = null;
				try {
					ois = new ObjectInputStream(new FileInputStream(versionFile));
					return (Map<String, String>) ois.readObject();
				}
				catch (IOException ioe) {
					LOGGER.warn("Unable to read the cache for {}-{}", projectName, projectVersion);
				}
				catch (ClassNotFoundException cnfe) {
					LOGGER.warn("The cache for {}-{} is corrupted.", projectName, projectVersion);
				}
				finally { if (ois != null) { try { ois.close(); } catch (IOException ioe) {} } }
			}
		}
		
		return new HashMap<>();
	}
817178
public synchronized Map<String, Object> getProperties() {
        if (properties == null) {
            return Collections.emptyMap();
        }
        return Collections.unmodifiableMap(new HashMap<>(properties));
    }
655924
private Map createRowIdCache() {
		List<?> data = (List<?>) getData();
		Map<Object, Object> dataByRowId = new HashMap<>(data.size());

		UIContext uic = UIContextHolder.getCurrent();

		if (uic != null) {
			uic.getScratchMap(this).put(SCRATCHMAP_DATA_BY_ROW_ID_KEY, dataByRowId);
		}

		for (int i = 0; i < data.size(); i++) {
			Object bean = data.get(i);
			dataByRowId.put(getRowId(bean), bean);
		}

		return dataByRowId;
	}
54502
@Override
    protected final T create(Object... args) {
        final K key = this.getKey(args);
        final T value = this.createInternal(key, args);
        this.objectCache.put(key, value);
        return value;
    }
1151013
protected static ArrayCache getArrayCache() {
        ArrayCache cache = (ArrayCache) AppContext.getAppContext().get(ArrayCache.class);

        if (cache == null) {
            cache = new ArrayCache();
            AppContext.getAppContext().put(ArrayCache.class, cache);
        }

        return cache;
    }
1035116
public @NotNull String build() {
    SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);

    // gather resource paths in a treeset (having them in a defined order helps with caching)
    SortedSet<String> resourcePathsSet = new TreeSet<>();

    // iterate over all parts that should be kept from the current request
    for (String nextPart : initialSuffixParts) {
      // if this is a key-value-part:
      if (nextPart.indexOf(KEY_VALUE_DELIMITER) > 0) {
        String key = decodeKey(nextPart);
        // decode and keep the part if it is not overridden in the given parameter-map
        if (!sortedParameterMap.containsKey(key)) {
          String value = decodeValue(nextPart);
          sortedParameterMap.put(key, value);
        }
      }
      else {
        // decode and keep the resource paths (unless they are specified again in resourcePaths)
        String path = decodeResourcePathPart(nextPart);
        if (!resourcePaths.contains(path)) {
          resourcePathsSet.add(path);
        }
      }
    }

    // copy the resources specified as parameters to the sorted set of paths
    if (resourcePaths != null) {
      resourcePathsSet.addAll(ImmutableList.copyOf(resourcePaths));
    }

    // gather all suffix parts in this list
    List<String> suffixParts = new ArrayList<>();

    // now encode all resource paths
    for (String path : resourcePathsSet) {
      suffixParts.add(encodeResourcePathPart(path));
    }

    // now encode all entries from the parameter map
    for (Entry<String, Object> entry : sortedParameterMap.entrySet()) {
      Object value = entry.getValue();
      if (value == null) {
        // don't add suffix part if value is null
        continue;
      }
      String encodedKey = encodeKeyValuePart(entry.getKey());
      String encodedValue = encodeKeyValuePart(value.toString());
      suffixParts.add(encodedKey + KEY_VALUE_DELIMITER + encodedValue);
    }

    // finally join these parts to a single string
    return StringUtils.join(suffixParts, SUFFIX_PART_DELIMITER);
  }
462976
public InternalQueryCache<K, V> tryCreateQueryCache(String mapName, String cacheName,
                                                        ConstructorFunction<String, InternalQueryCache<K, V>> constructor) {

        ContextMutexFactory.Mutex mutex = lifecycleMutexFactory.mutexFor(mapName);
        try {
            synchronized (mutex) {
                ConcurrentMap<String, InternalQueryCache<K, V>> queryCacheRegistry
                        = getOrPutIfAbsent(queryCacheRegistryPerMap, mapName, queryCacheRegistryConstructor);

                InternalQueryCache<K, V> queryCache = queryCacheRegistry.get(cacheName);
                // if this is a recreation we expect to have a Uuid otherwise we
                // need to generate one for the first creation of query cache.
                String cacheId = queryCache == null
                        ? UuidUtil.newUnsecureUuidString() : queryCache.getCacheId();

                queryCache = constructor.createNew(cacheId);

                if (queryCache != NULL_QUERY_CACHE) {
                    queryCacheRegistry.put(cacheName, queryCache);
                    return queryCache;
                }

                return null;
            }
        } finally {
            closeResource(mutex);
        }
    }
901967
public static AnnotatorCache getInstance() {
      if (INSTANCE == null) {
         synchronized (AnnotatorCache.class) {
            if (INSTANCE == null) {
               INSTANCE = new AnnotatorCache();
            }
         }
      }
      return INSTANCE;
   }
1144521
<K, V> Cache<K, V> createCache() {
    return CacheBuilder.newBuilder()
        .maximumSize(cacheMaxSize)
        .expireAfterWrite(cacheTtlSeconds, TimeUnit.SECONDS)
        .ticker(cacheTicker)
        .build();
  }
1204915
protected Apikey createNowFromMap(@Nullable String user, long duration, @Nullable List<String> roles, Map<String, Object> nameAndValMap) {
		return createNowFromMap(user, duration, toArr(roles), nameAndValMap);
	}
1034046
@Override
    public <K extends Serializable, V> Map<K, V> getCache() {
        return this.getCache(DEFAULT);
    }