Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AJDT and and referencing aspects with aspectOf()

The JDT Java editor doesn't understanding the AspectJ type system, so where aspects extend the base Java model (such as the "aspectOf" method), the editor is unaware of them and highlights things like "aspectOf" as potential errors. At compile time of course, AspectJ compiles the file quite happily.

The solution is to go to the package explorer and select "open with... AspectJ/Java editor" for the file. This editor is an extension of the Java one and *does* understand the AJ type system.

On 12/04/06, Ken Pelletier <ken@xxxxxxxx> wrote:
Within an ADJT project, if I have a JUnit TestCase in which I want to
instantiate an aspect (from the same project) using aspectOf().

In doing this, the test case gets errors in the gutters on references
the aspect class:  "cannot be resolved as a type", and I am also
unable to import the aspect class in eclipse.

I can, however launch the test and it runs and passes.

Is there a configuration to get around this?

I find I can open the TestCase with the AspectJ editor and it then
works, but it strikes me that there must be something else I'm
missing.  It is just a java class after all.

Can somebody please enlighten me?

Thanks,

- Ken

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



--
-- Adrian
adrian.colyer@xxxxxxxxx

Back to the top