Bug 83377 - compiler error on inheritance/overriding using introduction
Summary: compiler error on inheritance/overriding using introduction
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.0 M3   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-21 04:43 EST by mariano CLA
Modified: 2005-08-21 16:04 EDT (History)
0 users

See Also:


Attachments
interface I (71 bytes, text/x-java)
2005-01-21 04:43 EST, mariano CLA
no flags Details
class C - implementing I, containing no methods (31 bytes, text/x-java)
2005-01-21 04:44 EST, mariano CLA
no flags Details
aspect A - introducing a metohd into class C (127 bytes, text/x-java)
2005-01-21 04:45 EST, mariano CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mariano CLA 2005-01-21 04:43:05 EST
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 {}
Comment 1 mariano CLA 2005-01-21 04:43:43 EST
Created attachment 17359 [details]
interface I
Comment 2 mariano CLA 2005-01-21 04:44:56 EST
Created attachment 17360 [details]
class C - implementing I, containing no methods
Comment 3 mariano CLA 2005-01-21 04:45:31 EST
Created attachment 17361 [details]
aspect A - introducing a metohd into class C
Comment 4 Adrian Colyer CLA 2005-03-23 09:17:49 EST
for resolution in aj5m3
Comment 5 Adrian Colyer CLA 2005-08-21 16:04:20 EDT
fixed in tree.

The JDT's MethodVerifier was not finding the ITD when checking for legal overrides.