Bug 83303 - complier error when mixing inheritance, overriding and polymorphism
Summary: complier error when mixing inheritance, overriding and polymorphism
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-20 08:47 EST by mariano CLA
Modified: 2005-01-21 03:06 EST (History)
0 users

See Also:


Attachments
class A which define protected method m1 (36 bytes, text/x-java)
2005-01-20 08:49 EST, mariano CLA
no flags Details
class B which extends A (and inherits m1) (21 bytes, text/x-java)
2005-01-20 08:50 EST, mariano CLA
no flags Details
interface I which define method m1 (36 bytes, text/x-java)
2005-01-20 08:50 EST, mariano CLA
no flags Details
aspect C which crosscut B (69 bytes, text/x-java)
2005-01-20 08:51 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-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