Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RES: [aspectj-users] Abstract aspects

Thanks Jeff!


 

-----Mensagem original-----
De: aspectj-users-admin@xxxxxxxxxxx [mailto:aspectj-users-admin@xxxxxxxxxxx]
Em nome de Jeffrey Palm
Enviada em: quarta-feira, 24 de março de 2004 10:19
Para: aspectj-users@xxxxxxxxxxx
Assunto: Re: [aspectj-users] Abstract aspects

André Dantas Rocha wrote:

> Hi,
>  
> I'm receving an error when trying to concretize a pointcut in an 
> aspect that belongs to another package. The message is:
> "inherited abstract pointcut package1.AbstractAspect.test() is not 
> made concrete in package2.ConcreteAspect"
> My code is shown bellow. If I move the ConcreteAspect to the package1 
> the code works fine.
>  
> Any suggestions?
>  
> Thanks,
>  
> André
>  
> -----------------------------------------
> package package1;
>  
> public abstract aspect AbstractAspect {
>   abstract pointcut test();
> }
> -----------------------------------------
>  
> package package2;
>  
> import package1.*;
>  
> public aspect ConcreteAspect extends AbstractAspect {
>   pointcut test() : execution(* *(..)); }
> -----------------------------------------
>  
> package package2;
>  
> public class Test {
>   public static void main(String[] args) {
>     System.out.println("test");
>   }
> }
>  
>  

Make the pointuct 'public'...

   public abstract pointcut test();

Notice the same behavior with abstract classes and methods, though jikes
seems to be a bit more informative:

package p1;
public abstract class A { abstract void f(); }

-------

package p2;
public class C extends p1.A { void f() {} }

 >>>>>>>>>>>>>>>>>>

      2. public class C extends p1.A { void f() {} }
                      ^
*** Semantic Error: The abstract method "void f();",
     belonging to the superclass "p1.A", has default access,
     so it is not inherited and cannot be implemented in this
     package. Therefore, class "p2.C" must be abstract.

Jeff
--
Jeffrey Palm --> http://www.ccs.neu.edu/home/jpalm
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top