Subject: RE: Minor bug in the Any class...
From: Karl Lieberherr (klieberherr@earthlink.net)
Date: Mon Oct 14 2002 - 21:26:54 EDT
Hi Paul:
thank you for your thorough analysis. I agree with it
and I ran into this very problem myself. Pencheng Wu
helped me find the reason.
I decided not to put this into the first few versions of
our checkers because I did not want to introduce too
many features of AspectJ all at once.
Now that we have covered cflow we are ready to improve
our checkers as you propose.
-- Karl
> -----Original Message-----
> From: Paul Freeman [mailto:pfreeman@ccs.neu.edu]
> Sent: Sunday, October 13, 2002 11:03 AM
> To: Dr. Karl J. Lieberherr
> Cc: com3205@ccs.neu.edu
> Subject: Minor bug in the Any class...
>
>
> Hi Karl -
>
> While working with homework 3, I noticed that there is a slight bug in
> the Any class. The declaration of the "scope" pointcut is to broad,
> allowing for possible infinite recursions. I believe it should be:
>
> private pointcut scope(): !within(lawOfDemeter..*) &&
> !cflow(call(* lawOfDemeter..*(..))); // not in this package or
> within the
> // controlflow
> of a call in this package
>
> I noticed this problem when testing the argument checker (part 2) with
> the Foo class from HW2. The Foo class overrides the method "toString()"
> from object. This is significant because it is possible to call Foo's
> toString method from within the Supplier.at(JoinPoint jp) method call.
> Supplier's method at produces a string by concatinating "jp.getThis()"
> (as well as jp.getTarget()) to another string. Since the call to
> "jp.getThis()" in a string concatination in the Java language is
> actually translated to "jp.getThis().toString()" by the java compiler,
> if we are examining method executions with our Checker aspect and we
> call Supplier.at from within the execution examination, we can
> infinately recurse while examining Foo.toString(). The above addition of:
> !cflow(call(* lawOfDemeter..*(..)))
> to the scope class will alleviate any infinite recursions by calling
> methods in our lawOfDemeter package that we are examining outside of our
> lawOfDemeter package.
>
> Do you agree?
>
> Paul
>
>
>
This archive was generated by hypermail 2b28 : Mon Oct 14 2002 - 21:23:53 EDT