fail in compiling aspect with overriding method introduction with different throws clause
TypeBinding[] argumentTypes)
{
MethodBinding ret = sourceTypeBinding.getExactMethodBase(selector, argumentTypes);
- if (ret != null) return ret;
+ // An intertype declaration may override an inherited member (Bug#50776)
for (int i=0, len=interTypeMethods.size(); i < len; i++) {
MethodBinding im =
(MethodBinding)interTypeMethods.get(i);
return im;
}
}
- return null;
+ return ret;
}
// if (isVisible(im, sourceTypeBinding)) {
// if (ret == null) {
<message kind="warning" line="21" text="this affected type is not exposed"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs" pr="50776"
+ title="fail in compiling aspect with overriding method introduction with different throws clause ">
+ <compile files="IntertypeDifferentThrows.java" />
+ </ajc-test>
</suite>
--- /dev/null
+class A {
+ public A(){}
+ public void m() throws Exception{}
+}
+
+class B extends A {
+ public B(){}
+ public void some_code(){
+ m();
+ }
+}
+
+// B.m() introduced here does not throw 'Exception' so class B above
+// should compile OK!
+aspect C {
+ public void B.m(){}
+}
\ No newline at end of file