Bug 155358 - Can't reference pointcut in top-level interface
Summary: Can't reference pointcut in top-level interface
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-28 02:25 EDT by Ron Bodkin CLA
Modified: 2006-08-30 06:32 EDT (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 2006-08-28 02:25:27 EDT
The following program fails on recent dev builds and on 1.5.2. 

// top level package
public interface Interface {
    pointcut foo() : execution(* foo());
}

package user;

public aspect Caller {
    before() : Interface.foo() {}
}

>ajc Interface.java user\Caller.java
C:\devel\scratch\interfacePcd\user\Caller.java:4 [error] can't bind type name 'I
nterface'
before() : Interface.foo() {}
           ^^^^^^^^

1 error
Comment 1 Matthew Webster CLA 2006-08-30 06:32:35 EDT
This is a Java problem. After JDK 1.3 you cannot access types in the default package from a type that isn't. The following example will only compile (even in a vanilla Java project) when using "Compiler compliance leve: 1.3" (but won't with javac unless you are actually using JDK 1.3 not "-src 1.3"):

public interface Interface {
}


package user;
import Interface;
public class Caller implements Interface {
}