Community
Participate
Working Groups
While the Eclipse Javadoc popup on private members, their getters and their setters is extremely helpful, it's very reasonable to not add documentation in three places. That is so, because copying documentation is an additional expenditure itself and changes would have to be applied in all these places. So here's what I'd like to propose. Let's say we have this class: class Human { /** Name of the human */ private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } When showing the Javadoc popup for one of the getters or setters, Eclipse could show the original object member documentation in the case there's no existing documentation on the method. One easy solution, albeit not the best one would be to implicitly add this Javadoc: For getters: /** * @return {@link #name} */ For setters: /** * @param name {@link #name} */ This is an almost static replacement for empty Javadoc. The only dynamic part here is #name. A more sophisticated solution would be to show the complete original Javadoc.
Hint: When generating getters and setters you can also choose to add the comments.
Yep, I know that, but - changes would have to be applied in all these places and - that's boilerplate code which makes classes larger Thanks!