diff options
-rw-r--r-- | src/main/javassist/util/proxy/RuntimeSupport.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/javassist/util/proxy/RuntimeSupport.java b/src/main/javassist/util/proxy/RuntimeSupport.java index 687fc8dc..3971e395 100644 --- a/src/main/javassist/util/proxy/RuntimeSupport.java +++ b/src/main/javassist/util/proxy/RuntimeSupport.java @@ -50,11 +50,15 @@ public class RuntimeSupport { String thisMethod, int index, String desc, java.lang.reflect.Method[] methods) { - synchronized (methods) { - if (methods[index] == null) { - methods[index + 1] = thisMethod == null ? null - : findMethod(self, thisMethod, desc); - methods[index] = findSuperMethod(self, superMethod, desc); + if (methods[index] == null) { + Method m1 = thisMethod == null ? null + : findMethod(self, thisMethod, desc); + Method m0 = findSuperMethod(self, superMethod, desc); + synchronized (methods) { + if (methods[index] == null) { + methods[index + 1] = m1; + methods[index] = m0; + } } } } |