@SuppressWarnings("unchecked")
private static Map<String, ModuleDef> getModulesCache() {
ClassLoader keyClassLoader = Thread.currentThread().getContextClassLoader();
Map<String, ModuleDef> cache = loadedModulesCaches.get(keyClassLoader);
if (cache == null) {
cache = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
loadedModulesCaches.put(keyClassLoader, cache);
}
return cache;
}