Bug 32399 - Incorrect binding of protected (marker) interfaces
Summary: Incorrect binding of protected (marker) interfaces
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P2 critical (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-20 15:21 EST by Ron Bodkin CLA
Modified: 2003-03-06 17:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2003-02-20 15:21:51 EST
The following test case fails to compile in AspectJ 1.1 beta 4, and works 
correctly in AspectJ 1.0. The only work around is to make interfaces public, 
which is a serious problem.

file TransactionControl.aj (default package):
import sub.ObserverProtocol;

aspect TransactionControl {
    void begin() {
        CommitObserver.aspectOf().add(this);
    }
    static aspect CommitObserver extends ObserverProtocol {
        declare parents: TransactionControl implements Observer;
    }
}

file sub/ObserverProtocol.aj
package sub;

public abstract aspect ObserverProtocol {  
    protected interface Observer { }
    public void add(Observer o) {}
}

Sample compilation:
C:\devel>ajc sub\ObserverProtocol.aj TransactionControl.aj
can't bind type name 'Observer'
C:/devel/TransactionControl.aj:5: The method add(sub.ObserverProtocol.Observer)
in the type sub.ObserverProtocol is not applicable for the arguments (Transactio
nControl)
CommitObserver.aspectOf().add(this);
                          ^^^

2 errors
Comment 1 Jim Hugunin CLA 2003-03-06 17:03:17 EST
fixed in current tree, test in bugs/interfaceNames/*