This commit is contained in:
@@ -177,19 +177,21 @@ public final class ResourceFactory {
|
|||||||
checkName(name);
|
checkName(name);
|
||||||
ConcurrentHashMap<String, ResourceEntry> map = this.store.get(clazz);
|
ConcurrentHashMap<String, ResourceEntry> map = this.store.get(clazz);
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
ConcurrentHashMap<String, ResourceEntry> sub = new ConcurrentHashMap();
|
synchronized (clazz) {
|
||||||
sub.put(name, new ResourceEntry(rs));
|
map = this.store.get(clazz);
|
||||||
store.put(clazz, sub);
|
if (map == null) {
|
||||||
return null;
|
map = new ConcurrentHashMap();
|
||||||
} else {
|
store.put(clazz, map);
|
||||||
ResourceEntry re = map.get(name);
|
}
|
||||||
if (re == null) {
|
|
||||||
map.put(name, new ResourceEntry(rs));
|
|
||||||
} else {
|
|
||||||
map.put(name, new ResourceEntry(rs, name, re.elements, autoSync));
|
|
||||||
}
|
}
|
||||||
return re == null ? null : (A) re.value;
|
|
||||||
}
|
}
|
||||||
|
ResourceEntry re = map.get(name);
|
||||||
|
if (re == null) {
|
||||||
|
map.put(name, new ResourceEntry(rs));
|
||||||
|
} else {
|
||||||
|
map.put(name, new ResourceEntry(rs, name, re.elements, autoSync));
|
||||||
|
}
|
||||||
|
return re == null ? null : (A) re.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <A> A find(Class<? extends A> clazz) {
|
public <A> A find(Class<? extends A> clazz) {
|
||||||
|
|||||||
Reference in New Issue
Block a user