Project: AspectJ
Bug 50776 fail in compiling aspect with overriding method introduction with different throws clause
Reported: 2004-01-28 12:21:31 | Status: resolved fixed

A first class (class A) declares only one method with some exceptions in the throws clause ( void m() throws Exception ). A second class (class B) extends it without redefinig the method. An aspect declares a method introduction in the class B, with the same name, signature and return type of the one in class A, but without throws clause; this is a legal override. In the second class (class B) each invocation to the overriden method doesn't need a try-catch block, because it refers to his hown method that raises no exception. This code compiles using ajc version 1.0.6 (built Jul 24, 2002 6:21 PM PST) running on java 1.4.0 But not using AspectJ Compiler 1.1.1 AspectJ Compiler 1.1.0 class A{ public A(){} public void m() throws Exception{} } class B extends A{ public B(){} public void some_code(){ m();} } aspect C{ public void B.m(){} }

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java tests/bugs/IntertypeDifferentThrows.java