diff --git a/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/ReflectionUtils.java b/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/ReflectionUtils.java index 31254962..ad1b5858 100644 --- a/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/ReflectionUtils.java +++ b/org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/ReflectionUtils.java @@ -35,12 +35,19 @@ public static Method getDeclaredMethod(Object object, String methodName, Class[] return null; } - for (Class clazz = object.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) { + Class clazz; + if ((object instanceof Class)) { + clazz = (Class) object; + } else { + clazz = object.getClass(); + } + do { try { return clazz.getDeclaredMethod(methodName, parameterTypes); } catch (Exception e) { } - } + clazz = clazz.getSuperclass(); + } while (clazz != Object.class); return null; }