hoeft (2) [Avatar] Offline

I use AspectJ1.5 and the JDK 5.0 and I want to implement an default interface description like it is described in the book on side 281.

If I wrote such an interface:

public interface MyInterface {

public abstract Context getXXX();

static aspect Impl { }


This code causes an compiler-error in eclipse with following errors:
- Syntax error on token "aspect", class expected
- aspect cannot be resolved to a type

Why doesn't the code work? My other stand-alone aspects are compiled without any problems.

Thanks for your help,
hoeft (2) [Avatar] Offline
Re: default implementation for interfaces

I solved the problem myself.

There is no problem with AspectJ. The code didn't work because Eclipse opened the file with the normal Java-Editor. The file is compiled correctly if I open it with the AspectJ Editor in Eclipse.