Bug 239539 - Problems extending an abstract aspect in another package
Summary: Problems extending an abstract aspect in another package
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P4 minor (vote)
Target Milestone: 1.6.2   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-03 19:56 EDT by Andrew Clement CLA
Modified: 2008-08-20 14:58 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 Andrew Clement CLA 2008-07-03 19:56:16 EDT
Very strange, reported on the list:

I am using eclipse right now to do my aspectj coding, and I can't seem
to create a concrete aspect in package x from an abstract aspect in
package y. I always get the error:
 "inherited abstract pointcut bar.PrintAround.method() is not made
concrete in foo.PrintAroundFoo"

Here is a small example that exhibits this issue:

package bar;

public abstract aspect PrintAround {

       abstract pointcut method();

       Object around(): method() {
               System.out.println("-before-");
               Object r = proceed();
               System.out.println("-after-");
               return r;
       }

}
//---------------------------------------------------

package foo;

public class Foo {
       public static void main (String[] args) {
               System.out.println("foo!");
       }
}
//---------------------------------------------------

package foo;

import bar.PrintAround;

public aspect PrintAroundFoo extends PrintAround {

       pointcut method() : call (void Main(String[]));

}
//---------------------------------------------------

I worked around this issue before, but right now I'm trying to create
a library of aspects, and it's a pain that I have to make the aspects
always be part of the application namespace.
Comment 1 Andrew Clement CLA 2008-07-13 11:54:57 EDT
abstract pointcut must be public for this to work - we need a better message in this case
Comment 2 Andrew Clement CLA 2008-08-20 14:58:14 EDT
test and fix committed. Now get:

error at pointcut method() : call (void Main(String[]));

PrintAroundFoo.java:7:0::0 pointcut 'bar.PrintAround.method()' is not visible from type 'foo.PrintAroundFoo' - cannot override