Community
Participate
Working Groups
The ajc compiler reports an error when a method introduction is used to override a method using a smaller exception set in "throws clause" (this is legal in OO). Let's start with a legal OO setting: - interface I extends "java.lang.Cloneable" and redefines the "clone" method with no exceptions in the throws clause - class C implements I and define "clone method" as required by I Let's move the method "clone" from C to a method introduction in the (new) aspect A - interface I as before - class C implements interface I, but it contains no methods - aspect A introduces "clone" method into C, as required by I The ajc compiler wrongly reports: C.java:1 [error] Exception CloneNotSupportedException in throws clause of Object.clone() is not compatible with I.clone() public class C implements I {}
Created attachment 17359 [details] interface I
Created attachment 17360 [details] class C - implementing I, containing no methods
Created attachment 17361 [details] aspect A - introducing a metohd into class C
for resolution in aj5m3
fixed in tree. The JDT's MethodVerifier was not finding the ITD when checking for legal overrides.