Javadoc tag @inheritDoc

M

Maneesh

I am encountring a strange problem. This is my sample javadoc comment
above the method :

/**
* This is a sample JAVA Doc class.
* @inheritDoc IDoc#getInboundChannel()
*/

I am using Eclipse3.2, if I mouse over IDOC I get the java doc as the
tool tip, but if I mouse over the getInboundChannel(), the javadoc
comments are not visible.

If I replace @inheritDoc tag with @see tag, the javadoc comments are
visible for mouse over on getInboundchannel() as well.

Any pointers, what can be wrong with the usage of @inheritDoc.
 
O

Owen Jacobson

I am encountring a strange problem. This is my sample javadoc comment
above the method :

/**
* This is a sample JAVA Doc class.
* @inheritDoc IDoc#getInboundChannel()
*/

I am using Eclipse3.2, if I mouse over IDOC I get the java doc as the
tool tip, but if I mouse over the getInboundChannel(), the javadoc
comments are not visible.

If I replace @inheritDoc tag with @see tag, the javadoc comments are
visible for mouse over on getInboundchannel() as well.

Any pointers, what can be wrong with the usage of @inheritDoc.

@inheritDoc doesn't do what you think it does. From the manual at
<http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/
javadoc.html#{@inheritDoc}>:

--
{@inheritDoc}
Inherits (copies) documentation from the "nearest" inheritable class
or implementable interface into the current doc comment at this tag's
location. This allows you to write more general comments higher up the
inheritance tree, and to write around the copied text.
This tag is valid only in these places in a doc comment:

In the main description block of a method. In this case, the main
description is copied from a class or interface up the hierarchy.
In the text arguments of the @return, @param and @throws tags of a
method. In this case, the tag text is copied from the corresponding
tag up the hierarchy.
See Automatic Copying of Method Comments for a more precise
description of how comments are found in the inheritance hierarchy.
Note that if this tag is missing, the comment is or is not
automatically inherited according to rules described in that section.
--

inheritDoc does not take a class or member name as an argument: it
inherits the document from the parent class's method of the same
name. That's all it does. Use @see or {@link} for what you're trying
to do.

Owen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top