【发布时间】:2020-06-20 06:50:26
【问题描述】:
我正在使用 NetBeans 并有以下代码:
public interface StackADT<E> extends Collection<E> {
boolean push(E element);
E pop();
E peek();
}
public class ArrayStack<E> implements StackADT<E> {
//other methods
/** Adds all the elements of a given collection to
* the stack.
* @param c the collection whose elements should be
* added.
* @return <br>{@code true} if the collection does not
* contain {@code null} elements.
*/
@Override
public boolean addAll(Collection<? extends E> c) {
//do stuff
}
}
当我为项目生成 Javadoc 时,它正确显示
this。但是,文档弹出窗口显示this。出于某种原因,return 标记显示了来自Collections' 文档的文本,这些文本应该被覆盖,但仅在弹出窗口中。我尝试重新启动 NetBeans 并重写该方法的 Javadoc 无效。有什么想法吗?
【问题讨论】:
-
重写方法并更改其返回类型的含义是不寻常的。这可能也是 NetBeans 将
@return从java.util.Collection<E>中提取出来的原因。