Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Field names for generic aspects

Given TestAspect<Test>, the behaviour of the declare parents statement
is exactly as if you had written

declare parents : Test implements HasTest;

so "T" will not appear anywhere.

On 21/09/05, David Pearce <david.pearce@xxxxxxxxxxxxx> wrote:
> Hi All,
> 
> I have another quick question about generic aspects.  Consider this:
> 
>  > class Test {}
>  >
>  > aspect TestAspect<T> {
>  >  interface HasTest {}
>  >
>  >  declare parents : T implements HasTest;
>  >
>  >  private int HasTest.x = 0;
>  > }
> 
> So, the question is, for TestAspect<Test>, what does the actual name for
> the x field which is inserted into Test look like?  I imagine something
> like this:
> 
>  > int ajc$interField$TestAspect$Test$HasTest$x;
> 
> Does that seem about right?  I guess the crucial point is that Test has
> been included in this name, since it is the concrete type of T.
> 
> Cheers,
> 
> Dave
> 
> 
> --
> Lecturer in Computer Science,
> School of Mathematics, Statistics and Computer Science,
> Victoria University of Wellington,
> PO Box 600,
> Wellington,
> New Zealand.
> 
> Office: Cotton 231
> Telephone: +64 4 463 5833
> URL: http://www.mcs.vuw.ac.nz/~djp
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


-- 
-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top