Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse how to refactor Javadoc source comment?

After making some changes to a method, I find it utterly annoying to have to manually re-factor the Javadoc source comment immediately preceding the method call. Is there a way to get Eclipse to automatically do this for you?

like image 594
tyler Avatar asked Nov 16 '11 20:11

tyler


People also ask

How do you comment javadoc in Eclipse?

Bear the following in mind when using Add Javadoc comment (Alt+Shift+J): To add a comment to a field, position the cursor on the field declaration. To add a comment to a method, position the cursor anywhere in the method or on its declaration.

How do you refactor in Eclipse?

Eclipse makes this absurdly easy to do. Right-click on almost anything and choose Refactor > Rename. Type in a new name for whatever it is, and make sure that the Update References checkbox is checked. This will ensure that all references in all of your code will be updated.

How do I change javadoc?

Simply go to: Window - Preferences - Java - Code Style - Code Templates - Comments - Types - Edit... and change ${user} to whatever you want.

How do I add a comment to a javadoc?

Add a Javadoc using automatic commentsType /** before a declaration and press Enter . The IDE auto-completes the doc comment for you.


3 Answers

I think that the only way to let eclipse automatically update your Java Doc based on the changes that you have done in the method signature is do the changes from the eclipse own menu function :

Refactor ---> Change Method Signature 

If you change a the method signature from here you get automatically updated the JAvadoc comment, otherwise you have to delete the entire javadoc comment and recreate it typing :

/** + <HIT ENTER>  
like image 164
aleroot Avatar answered Oct 01 '22 15:10

aleroot


Also, pressing Alt-Shift-J again will regenerate the javadocs. That's how I usually do it.

like image 23
Thom Avatar answered Oct 01 '22 15:10

Thom


Google's CodePro Analytix plugin for Eclipse will do that for you.

like image 32
Sri Sankaran Avatar answered Oct 01 '22 13:10

Sri Sankaran