当我通过内部静态方面实现接口时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;
} ...
}
}
它工作正常。所有文件都正确编织。 但它并不起作用我试图将方面和界面分成两个文件:
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;
}
...
}
和
public interface EventSpaceSupplement {
String getEventSpace();
EventSpaceSupplement setEventSpace(String name);
}
班级没有编织:
public class TestClass extends Timplements EventSpaceSupplement {
@Override
public EventSpaceSupplement setEventSpace(String eventSpaceName) {
this.baseSetEventSpace(eventSpaceName);
...
return this;
}
}
答案 0 :(得分:0)
问题解决了神奇的手鼓。 我正在添加java默认实现存根。例如:
public interface EventSpaceSupplement {
default String getEventSpace(){return null;}
}
重建。 EventSpaceSupplimentA导致compilaion覆盖错误。但然后我删除了默认实现。
代码完全相同。但在那之后,操纵方面莫名其妙地开始被编织。