Bug 85814 - Javadoc shouldn't be required for getters / setters
Summary: Javadoc shouldn't be required for getters / setters
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-18 07:25 EST by Johan Walles CLA
Modified: 2005-02-18 08:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.