java - AspectJ doesn't weave an interface when the aspect is outside the interface -


when implement interface via inner static aspect impl

public interface eventspacesupplement {     string geteventspace();     eventspacesupplement seteventspace(string name);             ...     static aspect impl {         private string eventspacesupplement.eventspace;         public string eventspacesupplement.geteventspace() {              return this.eventspace;         }         public eventspacesupplement seteventspace(string eventspacename) {              this.baseseteventspace(eventspacename);              return this;         }         public eventspacesupplement baseseteventspace(string eventspacename)          {             this.eventspace = eventspacename;             this.eventmanager = eventmanager.geteventlistenerforme(this.geteventspace(), this);             return this;          }        ...     }  } 

it works fine. files woven properly. doesn't work i'm trying separate aspect , interface 2 files:

public aspect eventspacesupplimenta {     private string eventspacesupplement.eventspace;     public string eventspacesupplement.geteventspace() {         return this.eventspace;      }     public eventspacesupplement seteventspace(string eventspacename) {         this.baseseteventspace(eventspacename);     return this;     }     public eventspacesupplement baseseteventspace(string eventspacename) {        this.eventspace = eventspacename;        this.eventmanager = eventmanager.geteventlistenerforme(this.geteventspace(), this);         return this; }     ... } 

and

public interface eventspacesupplement {     string geteventspace();     eventspacesupplement seteventspace(string name); } 

the class doesn't woven:

public class testclass extends timplements eventspacesupplement {     @override     public eventspacesupplement seteventspace(string eventspacename) {         this.baseseteventspace(eventspacename);         ...         return this;     } } 

idea looks fine in both cases, navigates through ctl+left click. class not woven , ajc complation error. enter image description here

problem solved magical tambourine. adding java default implementation stubs. example:

public interface eventspacesupplement {     default string geteventspace(){return null;} } 

rebuild. eventspacesupplimenta caused compilaion override error. then remove default implementation back.

the code absolutely same. after manipulation aspects inexplicably began woven.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -