Bug 47319 - Compiler warns on missing Javadoc tags for private methods.
Summary: Compiler warns on missing Javadoc tags for private methods.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-23 19:07 EST by Gary Gregory CLA
Modified: 2003-12-16 09:35 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 Gary Gregory CLA 2003-11-23 19:07:48 EST
The Java compiler warns on missing Javadoc tags for private methods. The Style
preference page has a checkbox to enable this feature for public methods. So
either the wording is wrong or there is a bug. Perhaps, the access level could
be specified for this *great* feature, from private all the way to public with
public  the default.
Thanks.
Version 3.0.m5.
Comment 1 Philipe Mulet CLA 2003-11-24 06:09:46 EST
I think the options are slightly misleading indeed, there are 2 things you can 
do:
1- enable the Javadoc validation
2- enable the check for missing Javadoc (on public methods)

I agree that the current presentation is somewhat leading to think the option 
(1) is further controlled by (2). Where these are rather orthogonal.
Comment 2 Philipe Mulet CLA 2003-12-02 07:39:30 EST
Moving to UI.
Comment 3 Dirk Baeumer CLA 2003-12-02 13:08:53 EST
Gary, do you have a test case. I tried it with N20011201 and private methods 
aren't flag with an error.
Comment 4 Gary Gregory CLA 2003-12-02 13:45:04 EST
Ah, I have narrowed the problem definition. You will get a warning on a private
method IF that method has an "warnable" javadoc comment. I would argue that
since you have two levels of settings "Javadoc" (J) AND "on public types"
(J-public):

(1) I should get the warnings (as below) if I only have (J) turned on and
(J-public) turned OFF. I then get ALL Javadoc warnings no matter where.

(2) I should NOT get the warnings (as below) if I have (J) turned ON and
(J-public) turned ON. I should only get warnings on public objects.

Perhaps this also argues for a more refined settings: You can get
public/package/protected/private as the level to detect for.

For example, in
http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons/codec/src/java/org/apache/commons/codec/language/DoubleMetaphone.java?rev=1.15

we have the method:

    /**
     * Handles 'A', 'E', 'I', 'O', 'U', and 'Y' cases
     */
    private int handleAEIOUY(String value, DoubleMetaphoneResult result, int 
                             index) {
        if (index == 0) {
            result.append('A');
        }
        return index + 1;
    }

With the warnings:

Severity	Description	Resource	In Folder	Location	Creation Time
	Javadoc: Missing tag for parameter result	DoubleMetaphone.java	Apache Jakarta
Commons/codec/src/java/org/apache/commons/codec/language	line 300	November 25,
2003 5:50:30 PM
	Javadoc: Missing tag for parameter value	DoubleMetaphone.java	Apache Jakarta
Commons/codec/src/java/org/apache/commons/codec/language	line 300	November 25,
2003 5:50:30 PM
	Javadoc: Missing tag for return type	DoubleMetaphone.java	Apache Jakarta
Commons/codec/src/java/org/apache/commons/codec/language	line 300	November 25,
2003 5:50:30 PM
	Javadoc: Missing tag for parameter index	DoubleMetaphone.java	Apache Jakarta
Commons/codec/src/java/org/apache/commons/codec/language	line 301	November 25,
2003 5:50:30 PM
Comment 5 Gary Gregory CLA 2003-12-02 13:45:56 EST
Dirk, you must mean the N200*3*... build ;-)
Comment 6 Dirk Baeumer CLA 2003-12-04 10:27:47 EST
There are two different issues here. The not optimal UI and a new feature 
request for fine grained control for Javadoc errors. I opened A separate bug 
for the UI issue (bug 48066). 

Regarding the fine grained control for Javadoc. Currently when reporting 
errors in Javadoc is switch on all errors in all Javadocs are reported. So if 
there is a wrong Javadoc for a private method it is flag as an error.

More fine grained control needs support from JDT/Core.
Comment 7 Frederic Fusier CLA 2003-12-13 16:29:19 EST
Fixed.

See bug 46854 for more details...
Comment 8 David Audel CLA 2003-12-16 09:35:28 EST
Verified for 3.0M6