]> source.dussan.org Git - javassist.git/commitdiff
Fix JASSIST-267 210/head
authorNingZhang-Ericsson <ning.n.zhang@ericsson.com>
Fri, 13 Jul 2018 08:48:13 +0000 (16:48 +0800)
committerNingZhang-Ericsson <ning.n.zhang@ericsson.com>
Fri, 13 Jul 2018 08:48:13 +0000 (16:48 +0800)
Clean code according to comments.

src/main/javassist/util/proxy/ProxyFactory.java

index da9e29c6aa7e66583792be63a729d95f87420232..646bbcc44295b9eb2f539089cd5abd831dc76a2a 100644 (file)
@@ -1216,12 +1216,9 @@ public class ProxyFactory {
     private static boolean areParametersSame(Method method, Method targetMethod) {
         Class<?>[] methodTypes = method.getParameterTypes();
         Class<?>[] targetMethodTypes = targetMethod.getParameterTypes();
-        int i = -1;
         if (methodTypes.length == targetMethodTypes.length) {
-            for (Class<?> clz : methodTypes) {
-                i++;
-
-                if (clz.equals(targetMethodTypes[i].getClass())) {
+            for (int i = 0; i< methodTypes.length; i++) {
+                if (methodTypes[i].getName().equals(targetMethodTypes[i].getName())) {
                     continue;
                 } else {
                     return false;