Bug 85814

Summary: Javadoc shouldn't be required for getters / setters
Product: [Eclipse Project] JDT Reporter: Johan Walles <johan.walles>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Johan Walles CLA 2005-02-18 07:25:04 EST
I'm using 3.1M4.

There is a warning I can enable for public methods without any Javadoc comments.

I'd like to be able to enable that warning for all methods except getters with
no parameters and setters with exactly one parameter.

The reason is that in many cases the workings of a [g|s]etter is so obvious that
a comment is just redundant:

public String getName() {
    return this.name;
}
Comment 1 Frederic Fusier CLA 2005-02-18 08:37:53 EST
Compiler has no way to know that a method is a getter or a setter due to the
fact that there's no real specification about this notion, only conventions.

You can use Source>Add Comment to generate your Javadoc comment on
getters/setters if does not already exist, so it is really easy to fix compiler
warnings.

Even if this generated comment is trivial and redundant, we cannot consider this
point as a problem which should be hidden by a specific compiler option.