|
Here’s a sample program with a
working form of the pointcut to pick out only default access (package friendly)
methods: public aspect TestDefaultDetection { pointcut
defaultMethod() : execution(!private !public !protected * *(..)); declare warning:
defaultMethod(): “default method”; void testMatch() {} public void testNoMatch()
{} } class Baz { public void alsoNoMatch()
{} } C:\devel\scratch\access>ajc
TestDefaultDetection.aj C:\devel\scratch\access\TestDefaultDetection.aj:4
[warning] default method void testMatch() {} ^^^^^^^^^^^^^^^^^^^
method-execution(void TestDefaultDetection.testMatch())
see also: C:\devel\scratch\access\TestDefaultDetection.aj:3::0 1 warning From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Hatton (AT/LMI) Actually, this doesn't work ... I
originally thought it did, but got a syntax error when I tried it. I've reverted to my original solution
unless anyone else has a better mechanism???? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Hatton (AT/LMI) Yes, I thought I had tried that and got an
error, but it definitely works. thanks for that!! From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Bodden You can do things
like this, I believe: execution((!private && !final && !public) *
com.ericsson.nms.cif.cs.transaction.*.*(..)) Eric From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Hatton (AT/LMI) Hi,
I
am trying to define a point but for methods in a particular package which are
either protected or package protected (default access). I
can't come up with anything better than this:
pointcut protectedTxMethods() : Is
there a better way, or is this the only way to do it??? /David
|
_______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
