Community
Participate
Working Groups
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.
Move to JDT/UI. Might belong to JDT/Text
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).
*** This bug has been marked as a duplicate of bug 114686 ***