[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Unexpected weaving

David,
 
I think you are correct, but without seeing the generated code I can not be certain.  Can you provide a simpler test case maybe that demonstrates what you are seeing?
 
Ron

________________________________

From: aspectj-users-bounces@xxxxxxxxxxx on behalf of David Hatton (AT/LMI)
Sent: Tue 10/10/2006 12:33 PM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving



But doesn't 

pointcut publicCsMethods() :
execution (public * com.ericsson.nms.cif.cs.*.*(..))

only match classes in com.ericsson.nms.cif.cs and not it's subpackages,
i.e. it shouldn't match cs.Configuration???



-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron DiFrango
Sent: 10 October 2006 17:05
To: aspectj-users@xxxxxxxxxxx; aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving

I wonder if it is a conflict between two on the various lines:

pointcut publicCsMethods() :
execution (public * com.ericsson.nms.cif.cs.*.*(..))

This matches everything in com.ericsson.nms.cif.cs

But this:

pointcut noTraceInternal()
    // no need to trace simple getter methods with no parameters
        : execution (public * com.ericsson.nms.cif.cs..*.get*()) ||
        // no need to trace simple boolean methods with no parameters
          execution (public * com.ericsson.nms.cif.cs..*.is*());

Only excludes methids that start with get or is

________________________________

From: aspectj-users-bounces@xxxxxxxxxxx on behalf of David Hatton
(AT/LMI)
Sent: Tue 10/10/2006 11:00 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving



Thanks for the help, but I don't understand why this is ...

is it because the noTraceInternal pointcut matches the IDL classes even
though the advice stipulates the noInternalClasses should be avoided???



________________________________

From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron DiFrango
Sent: 10 October 2006 15:31
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving


Well,

I see the following that would pick any classes in
com.ericsson.nms.cif.cs:

pointcut noTraceInternal()
    // no need to trace simple getter methods with no parameters
        : execution (public * com.ericsson.nms.cif.cs..*.get*()) ||
        // no need to trace simple boolean methods with no parameters
          execution (public * com.ericsson.nms.cif.cs..*.is*());

// Internal Public cslib methods
    pointcut publicCsMethods() :
        (execution (public * com.ericsson.nms.cif.cs.*.*(..)) ||
          execution (public * com.ericsson.nms.cif.cs.ldap.*.*(..))) &&
        ! omittedClasses() &&
        ! noTraceInternal();
    pointcut protectedCsMethods() :
        (execution(!public !private * com.ericsson.nms.cif.cs.*.*(..))
||
          execution(!public !private *
com.ericsson.nms.cif.cs.ldap.*.*(..))) &&
        ! noTraceInternal() &&
        ! omittedClasses();

That is why those are getting matched during yoru compile cycle and not
showing up in AJDT.

So, I am not certain you are doing anything wrong, it is just that your
pointcut is written in such a way to pickup everything in those
packages.

Why don't you want the IDL generated code matched?

________________________________

From: aspectj-users-bounces@xxxxxxxxxxx on behalf of David Hatton
(AT/LMI)
Sent: Tue 10/10/2006 9:35 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving


OK, the classes which end up being woven are IDL generated classes.
These classes all end up in a package called

com.ericsson.nms.cif.cs.Configuration (and further sub-packages).

My aspect picks up on classes in com.ericsson.nms.cif.cs and other
sub-packages but not Configuration (as far as I can see).

It's a bit complicated but here it is anyway ...

We could get around this by not generating the IDL until the weaving is
completed, but I would prefer to understand what I'm doing wrong.


________________________________

From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron DiFrango
Sent: 10 October 2006 14:04
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Unexpected weaving


Can you give more details like the aspect and the classes that appears
to be woven even though they should not be?

________________________________

From: aspectj-users-bounces@xxxxxxxxxxx on behalf of David Hatton
(AT/LMI)
Sent: Tue 10/10/2006 8:52 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Unexpected weaving



Hi,

I am encountering some problems with certain classes being woven when
not expected.

Looking at my aspects these classes should not match any of the defined
pointcuts, yet are being output as being woven when I run the ANT iajc
task in verbose mode.

Using AspectJ inbuilt into Eclipse it is showing these particular
classes as being un-affected by the aspect I have defined, i.e. there
are no cross-references being detected by the Eclipse plug-in.

Is there any way I can determine which advice is affecting the classes
concerned during the Ant task?

/David



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


<<winmail.dat>>