我有 2 个接口
package com.oneviewservices.oneview.client.widget;
import com.oneviewservices.oneview.client.presenter.IPresenter;
public interface IDisplay<D> {
void setPresenter(IPresenter<D> presenter);
IPresenter<D> getPresenter();
}
和
package com.oneviewservices.oneview.client.widget.dialogs;
import com.oneviewservices.oneview.client.widget.IDisplay;
public interface IDialogDisplay extends IDisplay<IDialogDisplay> {}
最后我有一个带有内部接口的类
package com.oneviewservices.oneview.client.presenter.clusterlist;
import com.oneviewservices.oneview.client.presenter.dialogs.DialogPresenter;
import com.oneviewservices.oneview.client.widget.dialogs.IDialogDisplay;
public ClusterInPresenter extends DialogPresenter<ClusterInPresenter.ClusterInDisplay> {
interface ClusterInDisplay extends IDialogDisplay {}
public ClusterInPresenter(ClusterInDisplay display) {
super(display)
}
}
现在,如果我像这样离开它,jenkins 中的编译器会以 for 失败"Cannot Find Symbol"
(IDialogDisplay
在内部接口声明的行)。当我像这样使用完整的 IDisplay 路径时:
package com.oneviewservices.oneview.client.presenter.clusterlist;
import com.oneviewservices.oneview.client.presenter.dialogs.DialogPresenter;
public ClusterInPresenter extends DialogPresenter<ClusterInPresenter.ClusterInDisplay> {
interface ClusterInDisplay extends com.oneviewservices.oneview.client.widget.dialogs.IDialogDisplay {}
public ClusterInPresenter(ClusterInDisplay display) {
super(display)
}
}
它将在詹金斯中编译
编辑: 来自詹金斯日志的完整错误
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/gfroud/.jenkins/jobs/1View4/workspace/src/main/java/com/oneviewservices/oneview/client/presenter/clusterlist/ClusterListInFileSelectPresenter.java:[25,43] cannot find symbol
symbol : class IDialogDisplay
location: class com.oneviewservices.oneview.client.presenter.clusterlist.ClusterListInFileSelectPresenter
[ERROR] /home/gfroud/.jenkins/jobs/1View4/workspace/src/main/java/com/oneviewservices/oneview/client/widget/clusterlist/dialogs/ClusterListInFileSelectDialog.java:[195,1] method does not override or implement a method from a supertype
[ERROR] /home/gfroud/.jenkins/jobs/1View4/workspace/src/main/java/com/oneviewservices/oneview/client/widget/clusterlist/dialogs/ClusterListInFileSelectDialog.java:[203,1] method does not override or implement a method from a supertype
[ERROR] /home/gfroud/.jenkins/jobs/1View4/workspace/src/main/java/com/oneviewservices/oneview/client/widget/clusterlist/dialogs/ClusterListInFileSelectDialog.java:[209,1] method does not override or implement a method from a supertype
[ERROR] /home/gfroud/.jenkins/jobs/1View4/workspace/src/main/java/com/oneviewservices/oneview/client/presenter/clusterlist/ClusterListInFileSelectPresenter.java:[23,102] type parameter com.oneviewservices.oneview.client.presenter.clusterlist.ClusterListInFileSelectPresenter.ClusterInDisplay is not within its bound
我的问题是:
为什么我必须使用该接口的完整路径而不是像往常一样导入它?
有关该主题的任何资源都会很有用。