int n = list.size();
for (int i = 0; i < n; ++i) {
MethodInfo minfo = (MethodInfo)list.get(i);
- if (minfo.getName().equals(methodName)) {
+ if (minfo.getName().equals(methodName)
+ && (minfo.getAccessFlags() & AccessFlag.BRIDGE) == 0) {
int res = compareSignature(minfo.getDescriptor(),
argTypes, argDims, argClassNames);
if (res != NO) {
if (onlyExact)
maybe = null;
else
- onlyExact = maybe != null;
+ if (maybe != null)
+ return maybe;
int mod = clazz.getModifiers();
boolean isIntf = Modifier.isInterface(mod);
assertEquals(1, annotations.length);
}
+ public void testJIRA250() throws Exception {
+ CtClass cc = sloader.makeClass("test5.JIRA250", sloader.get("test5.JIRA250Super"));
+ cc.addMethod(CtNewMethod.make(
+ " public test5.JIRA250Bar getBar() {" +
+ " return super.getBar();\n" +
+ " }\n", cc));
+ cc.addMethod(CtNewMethod.make("public int run() { getBar(); return 1; }", cc));
+ cc.writeFile();
+ Object obj = make(cc.getName());
+ assertEquals(1, invoke(obj, "run"));
+ }
+
public void testProceedToDefaultMethod() throws Exception {
CtClass cc = ClassPool.getDefault().get("test5.ProceedDefault");
CtMethod mth = cc.getDeclaredMethod("bar");
--- /dev/null
+package test5;
+
+interface JIRA250BarI {
+ int foo();
+}
+
+class JIRA250Bar implements JIRA250BarI {
+ public int foo() { return 1; }
+}
+
+interface JIRA250SuperI {
+ JIRA250BarI getBar();
+}
+
+public class JIRA250Super extends JIRA250Super2 implements JIRA250SuperI {
+}
+
--- /dev/null
+package test5;
+
+public class JIRA250Super2 {
+ public JIRA250Bar getBar() { return null; }
+}