Bug 280176 - Javadoc templates need new variable
Summary: Javadoc templates need new variable
Status: RESOLVED DUPLICATE of bug 114686
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-13 18:48 EDT by Etienne Lacombe CLA
Modified: 2009-06-15 08:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Etienne Lacombe CLA 2009-06-13 18:48:22 EDT
Build ID: 3.5 - I20090528-2000

Steps To Reproduce:
It would be great to have an additional variable in the comments (Javadoc) templates for the Javadoc of the referenced variable.

This is for getters and setters. 

For example, I create a class attribute:

/** 
 * The first name of the person.
 */
private String firstName;


I would like that the getter's comment be set to (automatically):

/**
 * The first name of the person.
 */
public String getFirstName ()
{
   return firstName;
}

and the setter similarly.

Ideally, it would do:

/**
 * Returns the first name.
 */

but I would be way happy with the first example.

When I was using Emacs, I had macros that would take the attributes and automatically create the getters and setters, using this scheme of comments.

This removes a lot of redundant typing.

Some may argue that I don't need to put comments on the private attribute - fine but I like to and that's my preference.

I don't know how much work is involved in adding such a variable in the templates.


Maybe if someone would point me out a way I could do it for me I would be happy with that to.
Comment 1 Olivier Thomann CLA 2009-06-14 22:21:43 EDT
Move to JDT/UI. Might belong to JDT/Text
Comment 2 Markus Keller CLA 2009-06-15 06:51:40 EDT
We could add a variable that contains the main description of the field's Javadoc.

In the getter and setter templates, you would of course put this after @param and @return tags. Added smartness to conform to the Javadoc style guide could be to make the first character lowercase and remove the terminating '.' if the original comment contains exactly 1 '.' (and the '.' is at the end of the comment).
Comment 3 Markus Keller CLA 2009-06-15 08:03:39 EDT

*** This bug has been marked as a duplicate of bug 114686 ***