Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Pointcut declaration in interfaces

Hello,

I am currently reading Eclipse AspectJ and found
that pointcut declarations are only allowed in classes and
aspects and not in interfaces. The Aspectj documentation also
states this. I was a little bit surprised, because I had something
different in my mind and started to write a little test case. With success.

With AJDT 1.2 and AspectJ 1.2 I could declare a pointcut in an interface.
Is this a bug? Or in which version was this feature introduced? Does anybody
know the background why this was(?) prohibited and now(?) is allowed?

Thanks a lot,
Vincenz

// litte test:
public interface TestIF {

    pointcut test(): call(String toString());
}

public aspect TestAspect {

    after(): TestInterface.test() {
	System.out.println("toString called");
    }
}




Back to the top