James 7 年 前
コミット
3847e774db
1 ファイル変更2 行追加3 行削除
  1. 2 3
      src/main/java/com/jfinal/aop/AopFactory.java

+ 2 - 3
src/main/java/com/jfinal/aop/AopFactory.java

@@ -24,8 +24,7 @@ public class AopFactory {
 	public <T> T get(Class<T> targetClass) {
 	public <T> T get(Class<T> targetClass) {
 		try {
 		try {
 			return get(targetClass, injectDepth);
 			return get(targetClass, injectDepth);
-		}
-		catch (ReflectiveOperationException e) {
+		} catch (ReflectiveOperationException e) {
 			throw new RuntimeException(e);
 			throw new RuntimeException(e);
 		}
 		}
 	}
 	}
@@ -49,7 +48,7 @@ public class AopFactory {
 		
 		
 		ret = singletonCache.get(targetClass);
 		ret = singletonCache.get(targetClass);
 		if (ret == null) {
 		if (ret == null) {
-			synchronized (targetClass) {
+			synchronized (this) {
 				ret = singletonCache.get(targetClass);
 				ret = singletonCache.get(targetClass);
 				if (ret == null) {
 				if (ret == null) {
 					ret = createObject(targetClass);
 					ret = createObject(targetClass);