Bug 83303

Summary: complier error when mixing inheritance, overriding and polymorphism
Product: [Tools] AspectJ Reporter: mariano <ceccato>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P3    
Version: 1.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
class A which define protected method m1
none
class B which extends A (and inherits m1)
none
interface I which define method m1
none
aspect C which crosscut B none

Description mariano CLA 2005-01-20 08:47:23 EST
Given this scenario:
- class A define method m1 (with proteceted visibility)
- class B extends class A and implements interface I and override method m1 (but
with public visibility)
- interface I define method m1 (with public  visibility)

The code is correct and compile using java 1.4

Let's modify the scenario:
move the method B.m1 into a method introduction on aspect C, such that
- class B extends class A
- apsect C intosuces method m1 into B (with public visibility) and makes B
implemts I (declare parents)
- A and I as before

The compiler reports this error:
B.java:1 [error] The inherited method A.m1() cannot hide the public abstract
method in I
class B extends A {
Comment 1 mariano CLA 2005-01-20 08:49:39 EST
Created attachment 17330 [details]
class A which define protected method m1
Comment 2 mariano CLA 2005-01-20 08:50:22 EST
Created attachment 17331 [details]
class B which extends A (and inherits m1)
Comment 3 mariano CLA 2005-01-20 08:50:52 EST
Created attachment 17332 [details]
interface I which define method m1
Comment 4 mariano CLA 2005-01-20 08:51:39 EST
Created attachment 17333 [details]
aspect C which crosscut B
Comment 5 Andrew Clement CLA 2005-01-20 09:50:28 EST
Thanks for the test programs.  I've added them as a testcase and checked in the
fix.  We intercept the Java compiler error reporting mechanism in a few places
and check if ITDs satisfy what the compiler thinks is an error.  This bug
highlights a missing case - I just made the ITD check and the program compiles fine.

I will close the bug report when a build with the fix in becomes available
(about 3 hours time).
Comment 6 Andrew Clement CLA 2005-01-21 03:06:16 EST
Fix available:

BUILD COMPLETE -  build.442
Date of build: 01/20/2005 19:14:23
Time to build: 117 minutes 4 seconds
Last changed: 01/20/2005 14:44:46
Last log entry: Fix for Bug 83303: complier error when mixing inheritance,
overriding and polymorphism
Latest good AspectJ jar available at:
download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar