@@ -104,7 +104,8 @@ public class MemberResolver implements TokenId { | |||
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) { | |||
@@ -121,7 +122,8 @@ public class MemberResolver implements TokenId { | |||
if (onlyExact) | |||
maybe = null; | |||
else | |||
onlyExact = maybe != null; | |||
if (maybe != null) | |||
return maybe; | |||
int mod = clazz.getModifiers(); | |||
boolean isIntf = Modifier.isInterface(mod); |
@@ -171,6 +171,18 @@ public class JvstTest5 extends JvstTestRoot { | |||
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"); |
@@ -0,0 +1,17 @@ | |||
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 { | |||
} | |||
@@ -0,0 +1,5 @@ | |||
package test5; | |||
public class JIRA250Super2 { | |||
public JIRA250Bar getBar() { return null; } | |||
} |