8 comments
Comment actions Permalink

Out of curiosity, what's the use? I mean, it sounds like duplication.

0
Comment actions Permalink

We have requirements that all public and protected methods have javadocs attached. It's also easier for reading: otherwise you have to jump around the code.

So:

@Override
public void myMethod(String foo, Object bar) throws Exception {
// ...
}


What does myMethod() do? I have to go to superclass to find out..

I want to suck in the javadoc for that method from the superclass.

0
Comment actions Permalink

A few things:

1) If you use "Implement methods" or "Override methods" you have the option of having the JavaDoc comments copied at that time.
2) If the overriding class contains a super.methodName(...) call, you can use CTRL-Q / Quick Documentation Lookup when the selection is in the method name to see the inherited JavaDoc comment.
3) The "javadoc" processor can pull JavaDoc comments down from the overridden methods.


Randall Schulz

0
Comment actions Permalink

Ctrl-Q will also show parent method JavaDoc if the current method has none.

0
Comment actions Permalink

attached the screenshot to better show Randall's correct answer

Edited by: Stephen Boesch on Oct 30, 2008 5:04 PM



Attachment(s):
copyJavadoc.JPG
0
Comment actions Permalink

I find using {@inheritdoc} is more elegant. Of course, it's supported by Idea with a CTRL-Q.

Sylvain

0
Comment actions Permalink

I had forgotten about @inheritdoc. thanks.

How does Ctrl-Q work? More specifically when can I use it?

Is there a way to insert the @Inheritdoc in the methods that I already had generated (and now have my own code) ?

0
Comment actions Permalink

Put the selection in a class, method or package name and type CTRL+Q (or select Quick Documentation Lookup from the View menu). You'll get a pop-up window with the formatted JavaDoc for that entity.


Randall Schulz

0

Please sign in to leave a comment.