Intellij : aspect not “detected” in editor

Answered

We are using a internally developed framework, which define some Aspects. For example :

public aspect AGhostable {

    @Column(name = "ghost", columnDefinition = "boolean default false")
    public boolean Ghostable.ghost;

    public void Ghostable.setGhost(boolean ghost) {
        this.ghost = ghost;
    }

    public boolean Ghostable.isGhost() {
         return this.ghost;
    }
 }

If we use create a class implementing the interface Ghostable in our framework, everything is fine in IntelliJ.
But if we create a class implementing the interface Ghostable in a project using our framework IntelliJ does not seems to detect our aspect in the editor : red underline, and says that the class must implements methods from the interface.
Note that the project build without any issue, it's just an issue in the editor.

We are using Maven to manage dependencies.

Do you have any idea of how I can fix this?

Thanks.

Initially posted on StackOverflow : https://stackoverflow.com/questions/46696566/intellij-aspect-not-detected-in-editor 

     
0
5 comments

Please share a sample project to reproduce the problem.

0
Avatar
Permanently deleted user

Hi Serge,

Sorry for the late answer.

I've created 2 samples projects on GitHub :

https://github.com/Czternasty/aspectroot : defining the aspect, you will need to "mvn install" this one

https://github.com/Czternasty/aspectexample : using the aspect defined in the other project, and if you look at "MyClass" is marked as error, but in Example you will see that the interface is correctly detected.

 

Thanks for your help.

 

 

0

`mvn install` fails:

[ERROR] Failed to execute goal on project aspectroot: Could not resolve dependencies for project net.czternasty:aspectroot:jar:1.0-SNAPSHOT: Could not find artifact net.czternasty:aspectroot:jar:1.0-SNAPSHOT -> [Help 1]

0
Avatar
Permanently deleted user

My bad, a dependency was wrong, I'v updated the project. Sorry.

0

Your example project fails to build with Maven as well:

[ERROR] /C:/work/attaches/aspectissue/aspectexample-master/src/net/czternasty/aspectexample/Example.java:[7,12] cannot find symbol
[ERROR] symbol: method isGhost()
[ERROR] location: variable myClass of type net.czternasty.aspectexample.MyClass
[ERROR] /C:/work/attaches/aspectissue/aspectexample-master/src/net/czternasty/aspectexample/MyClass.java:[5,8] net.czternasty.aspectexample.MyClass is not abstract and does not override abstract method setGhost(boolean) in net.czternasty.aspectroot.IGhostable
0

Please sign in to leave a comment.