[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Around + LTW missing method

> around call() advice tried to call a non-existent method.

what was the method?

> It turns out that not all weaving activity is reported in weaveinfo
> messages, as, in this case, the around call() expected to see the method
> added to the target class.

Yes, some activities are performed on classfiles that do not get
reported in weaveinfo messages.  The 'other end' of a cflow, the
privileged accessors created to make private fields visible outside of
a type - there are many many examples.

The weaveinfo messages are intended to relate to what the user was
doing with the syntax, and not to describe incidental changes - I mean
javac doesn't tell you when it adds a this$0 field or a secondary
constructor to a private inner class so that it is visible to the
containing class...  sometimes magic just happens to support what the
user was doing ;)

Nothing is different (or at least nothing should be different) between
ltw and compile time weaving - apart from what is accessible for
weaving of course.

If you want to add further diagnostics, then I would certainly
consider them different from regular weaveinfo messages but really
when do you need to see them?  In this case it sounds like a bug in
that something was allowed to happen that left the system inconsistent
(a method did not get added where expected) - and really that
shouldn't happen and whatever the cause was should be reported
earlier.

(I think we have an open enhancement request to add these for the
other end of the cflow, but not for any of the others).

Andy.

2009/4/21 Neale Upstone <neale.upstone@xxxxxxxxxx>:
> I’ve just had an interesting experience using LTW.
>
> I’d gone through my weaveinfo log looking at items where no weaving was
> reported, and filtering out a good chunk of those from being considered for
> weaving by using <exclude within=…/> in my aop.xml.
>
> I then found that some around call() advice tried to call a non-existent
> method.
>
> It turns out that not all weaving activity is reported in weaveinfo
> messages, as, in this case, the around call() expected to see the method
> added to the target class.
>
> Is this different behaviour to compile time weaving?
>
>
>
> It seems fair to add a method at load time to any target class, but at
> compile time, that class may be in a JAR that’s not getting woven.
>
>
>
> Seems to me that it would be useful for me to look to enhance the “debug
> weaving…” message, to say whether the class was modified or not, as I was
> relying on the subsequent weaveinfo message, which clearly doesn’t give the
> whole picture.
>
>
>
> If the above behaviour is correct, I’ll dig into the debug messages and make
> them unambiguous.
>
>
>
> Cheers,
>
> Neale
>
> **********************************************************************
> IMPORTANT NOTICE.
> Confidentiality:  This e-mail and its attachments are intended for the above
> named only and may be confidential.  If they have come to you in error you
> must take no action based on them, nor must you copy or show them to anyone;
> please reply to this e-mail and highlight the error.
> Security Warning:  Please note that this e-mail has been created in the
> knowledge that Internet e-mail is not a 100% secure communications medium.
> We advise that you understand and observe this lack of security when
> e-mailing us.
> Viruses:  Although we have taken steps to ensure that this e-mail and
> attachments are free from any virus, we advise that in keeping with good
> computing practice the recipient should ensure they are actually virus free.
> Monitoring and Scanning:  Cambridge Cognition has monitoring and scanning
> systems in place in relation to emails sent and received to: monitor /
> record business communications; prevent and detect crime; investigate the
> use of the Company's internal and external email system; and provide
> evidence of compliance with business practices.
>
> Cambridge Cognition Limited
> Company Registration Number 4338746
> Registered address:
> Tunbridge Court
> Tunbridge Lane
> Bottisham
> Cambridge
> CB25 9TU
> UK
> **********************************************************************
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>