未验证 提交 2a2a1d99 编写于 作者: G Guide哥 提交者: GitHub

Merge pull request #35 from tangj1992/patch-1

修改单例获取工厂
......@@ -18,7 +18,10 @@ public final class SingletonFactory {
public static <T> T getInstance(Class<T> c) {
String key = c.toString();
Object instance;
Object instance = OBJECT_MAP.get(key);
if (instance != null){
return c.cast(instance);
}
synchronized (SingletonFactory.class) {
instance = OBJECT_MAP.get(key);
if (instance == null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册