MentaContainer

Compare Revisions

Ignore whitespace Rev 136 → Rev 137

/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
502,13 → 502,13
}
 
@Override
public synchronized boolean check(Object key) {
public synchronized boolean check(Object obj) {
String keyString = key.toString();
String key = obj.toString();
if (!factoriesByName.containsKey(keyString)) return false;
if (!factoriesByName.containsKey(key)) return false;
Scope scope = scopes.get(keyString);
Scope scope = scopes.get(key);
if (scope == Scope.NONE) {
516,11 → 516,11
} else if (scope == Scope.SINGLETON) {
return singletonsCache.containsKey(keyString);
return singletonsCache.containsKey(key);
} else if (scope == Scope.THREAD) {
ThreadLocal<Object> t = threadLocalsCache.get(keyString);
ThreadLocal<Object> t = threadLocalsCache.get(key);
if (t != null) return t.get() != null;