Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Cannot get reference to the object

target(ves) is failing because the Vessel object does not exist.
Since the pointcut runs *before* the call to new, there is no object
to bind.

However, changing call to execution should work (as long as you are
able to weave into the Vessel class's constructor).

On Fri, Nov 27, 2009 at 9:17 AM, ivlev jenia <jenia2009@xxxxxxxxx> wrote:
>      pointcut instanceTracker(Vessel ves) :
> call(Vessel+.new(..))&&target(ves) ;
>      before (Vessel ves) : instanceTracker(ves){//   this is the place
> *************************
>          System.out.println(thisJoinPoint);
>          System.out.println(ves.getClass().getCanonicalName());
>      }
>
> but at "this is the place" the
>  compiler gives me  warning : advice defined in cut has not been applied
> [Xlint:adviceDidNotMatch]
> What is the problem?????
>
> if i do :
>
>
>      pointcut instanceTracker() :
>  call(Vessel+.new(..)) ;
>      before () : instanceTracker(){//   this is the place
> *************************
>          System.out.println(thisJoinPoint);
>  //        System.out.println(ves.getClass().getCanonicalName());
>      }
>
>
> everything works
> anyone knows whats the problem?
>
> ________________________________
> Make your browsing faster, safer, and easier with the new Internet Explorer®
> 8. Optimized for Yahoo! Get it Now for Free!
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top