Open the source file with the AspectJ editor and not the Java editor,
otherwise you will see that kind of message.  If that is not what is
going wrong for you, maybe open a bug report.

Andy.

2008/7/12 Mohan Radhakrishnan <[EMAIL PROTECTED]>:
> Hi,
>          I tried it and it works. Is the incremental compilation bug
> still there ? AJDT still shows that X.TLInterface cannot be resolved
> to a type.
>
> Thanks,
> Mohan
>
> On 7/8/08, Andy Clement <[EMAIL PROTECTED]> wrote:
>> Example:
>>  --- Test.java ---
>>  public class Test {
>>
>>   public static void main(String[] argv) {
>>     A a = new A();
>>     B b = new B();
>>     if (a instanceof X.TLInterface) System.out.println("A has it");
>>     if (b instanceof X.TLInterface) System.out.println("B has it");
>>   }
>>  }
>>
>>  class A {}
>>  class B {
>>   public void run() {}
>>  }
>>
>>  aspect X {
>>   interface TLInterface {}
>>
>>   ThreadLocal TLInterface.local;
>>
>>   declare parents: hasmethod(public void run(..)) implements TLInterface;
>>
>>  }
>>  ---------------
>>
>>  C:\temp>ajc -XhasMember Test.java -showWeaveInfo
>>  Type 'X$TLInterface' (Test.java) has intertyped field from 'X'
>>  (Test.java:'java.lang.ThreadLocal X$TLInterface.local')
>>
>>  Extending interface set for type 'B' (Test.java) to include
>>  'X$TLInterface' (Test.java)
>>
>>  Type 'B' (Test.java) has intertyped field from 'X'
>>  (Test.java:'java.lang.ThreadLocal X$TLInterface.local')
>>
>>
>>
>>  Andy.
>>
>>
>>  2008/7/7 100ji <[EMAIL PROTECTED]>:
>>
>> > Hi all,
>>  >
>>  > I want to add a ThreadLocal field to all the classes that contain the
>>  > run method using aspects. Currently, I have the following aspect code
>>  > that gives me a list of all classes that have the run method.
>>  >
>>  > public aspect AddTaintVarToThread {
>>  >       pointcut startThreads(): execution(void *.run());
>>  >
>>  >       before(Object o) : startThreads() && target(o){
>>  >       System.out.println("Hurray! Thread advice works!" +
>>  > o.getClass().getName());
>>  >       }
>>  > }
>>  >
>>  > Once I get the class name, can I add a field to the class inside a
>>  > method call in aspectj? Or more specifically, can I perform a
>>  > inter-type declaration inside the advice? If I can't do it this way,
>>  > are there better ways? I tried googling list archives but found
>>  > nothing. Any pointers will prove helpful.
>>  >
>>  > TIA,
>>  > -S-
>>  > _______________________________________________
>>  > aspectj-users mailing list
>>  > [email protected]
>>  > https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>  >
>>  _______________________________________________
>>  aspectj-users mailing list
>>  [email protected]
>>  https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to