I'm using NetBeans and have the following code:
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
}
}
When I generate the Javadoc for the project, it correctly shows
this. However, the documentation popup shows this. For some reason, the return
tag shows text from Collections
' documentation that's supposed to be overriden, but only in the popup. I've tried restarting NetBeans and rewriting the method's Javadoc to no effect. Any ideas?
It's a bug. I created an issue and PR for that. I think it will be fixed in 12.1.
You can check it easily. If you change your JavaDoc like this (move the return tag to the top):
/** Adds all the elements of a given collection to
* the stack.
* @return <br>{@code true} if the collection does not
* contain {@code null} elements.
*
* @param c the collection whose elements should be
* added.
*/
then the description of the param tag would be duplicated instead of the return tag: