Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] Parameter Annotations in Pointcuts

Ok, I see.

The use cases I have all come from the runtime verification domain
where you basically want to track the flow of objects. For that it
sometimes only matters which *methods* values flow to, but not through
which of the parameters. So you could imagine an advice like...

before(X x): execution(* foo(..)) && args(..,x,..) {
  //about to pass x to foo
}

For instance x could be some confidential piece of data that should
not flow into certain classes, etc.

Eric

2008/5/7 Andy Clement <andrew.clement@xxxxxxxxx>:
> There might be a bug somewhere to discuss using '..' twice, can't
>  remember the number.  But I hadn't initially imagined solving that
>  problem, more just allowing something just for parameter annotation
>  matching in any argument position - since I've seen this problem occur
>  more frequently now that parameter annotation matching is possible.
>  (However, if there is a nice solution to both, that would be OK
>  too...)
>  My current use case is something like this picking out the @NotNull
>  parameters here:
>
>  public void m(@NotNull String s) {}
>  public void m2(String s,@NotNull String t) {}
>  public void m3(String s,String u,@NotNull String v) {}
>  public void m3(String s,String u,@NotNull String v,@NotNull String w) {}
>
>  i want to write advice that relates to @NotNull marked parameters - I
>  don't care what the other parameters are, and I may not actually care
>  what the method is, I just want the parameters so I can check if they
>  are null. (and there may well be more than one in the argument list
>  that matches...).  My thoughts aren't well formed enough yet, so i
>  haven't opened a bug report.
>
>
>  cheers,
>  Andy.
>
>  2008/5/7 Eric Bodden <eric.bodden@xxxxxxxxxxxxxx>:
>
>
> > >  We are thinking about a construct that would get around requiring this
>  >  >  but haven't finished the design yet.
>  >
>  >  Andy, is this new construct going to be restricted only to annotation
>  >  matching or will it also allow people to write pointcuts like the
>  >  following?
>  >
>  >  pointcut intArgument(int i): args(..,i,..);
>  >
>  >  I have had a few use cases for such pointcuts. Is there a bug report
>  >  to discuss this feature?
>  >
>  >  Cheers,
>  >  Eric
>  >
>  >  --
>  >
>  >
>  > Eric Bodden
>  >  Sable Research Group
>  >  McGill University, Montréal, Canada
>
>
> >  _______________________________________________
>  >  ajdt-dev mailing list
>  >  ajdt-dev@xxxxxxxxxxx
>  >  https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>  >
>  _______________________________________________
>  ajdt-dev mailing list
>  ajdt-dev@xxxxxxxxxxx
>  https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


Back to the top