Bug 86769 - [javadoc] Warn/Error for 'Missing javadoc comments' doesn't recognize private inner classes
Summary: [javadoc] Warn/Error for 'Missing javadoc comments' doesn't recognize private...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Eric Jodet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 87500 101829 104419 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-26 23:40 EST by Reinier Zwitserloot CLA
Modified: 2007-10-29 08:18 EDT (History)
6 users (show)

See Also:


Attachments
Patch to fix this issue (41.48 KB, patch)
2006-03-24 06:42 EST, Frederic Fusier CLA
no flags Details | Diff
patch + test case (43.87 KB, patch)
2007-08-31 04:45 EDT, Eric Jodet CLA
no flags Details | Diff
patch + test case (44.86 KB, patch)
2007-08-31 07:11 EDT, Eric Jodet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Reinier Zwitserloot CLA 2005-02-26 23:40:46 EST
Setting 'Missing Javadoc comments' (under the Javadoc tab of compiler 
preferences, either globally in the preferences or as specific settings for a 
project) is a bit overzealous in what it does; most notably the following two 
situations are undesired:

 1. Any method of a higher visibility than the containing class (ie: a public 
void run() in a inner private class MyThread extends Thread) is marked as 
warning or error for a missing javadoc according to the higher visibility. This 
is undesired; in the previous example, if javadocs are generated only for 
protected and public elements, the public void run() in this inner private class 
will not show up anywhere in the generated javadocs. This error also occurs with 
private enums; the valid values for the enum are all marked as warnings even if 
you've set the 'only consider members as visible as' selector to Default or 
higher.

 2. There is no option to specify if enum values should count as public 
declarations; Right now all enumeration values in an enum are considered public 
fields and hence always generate a warning/error if the 'Missing javadoc 
comments' option is set to cause warnings or errors. I'd like to see a new 
checkbox under 'Missing Javadoc comments': 'Consider enum values'. Regardless of 
this feature, enums suffer the same bug/'misfeature' as listed in #1; even for 
private enums, the contained values are marked as public for purposes of 
determining if it needs a javadoc comment.

Last checked in 3.1M5a.
Comment 1 Frederic Fusier CLA 2005-03-08 12:36:42 EST
I'll fix problem 1) using this bug but not sure for point 2) (only if time permit).
To make it easier, please reopen a separated bug for this enhancement: 'Consider
enum values' for 'Missing Javadoc Comments'...
Thx
Comment 2 Reinier Zwitserloot CLA 2005-03-09 10:00:54 EST
(In reply to comment #1)
> I'll fix problem 1) using this bug but not sure for point 2) (only if time 
permit).
> To make it easier, please reopen a separated bug for this enhancement: 
'Consider
> enum values' for 'Missing Javadoc Comments'...
> Thx

Right. Thanks for fixing #1. I'll make a new feature request report for #2 now.
Comment 3 Frederic Fusier CLA 2005-03-13 13:44:11 EST
For new javadoc missing comment option for enum see bug 87500
Comment 4 Frederic Fusier CLA 2005-03-14 07:23:40 EST
Current (M6) effort is done on bugs which need API changes => move to M7
Comment 5 Frederic Fusier CLA 2005-05-17 11:23:19 EDT
Unfortunately, it was too late to finalize fix for point 1).
This kind of change is too risky at this late stage...
So, set as LATER, sorry about that.
Please reopen after 3.1 delivery
Comment 6 Frederic Fusier CLA 2005-06-27 04:56:33 EDT
*** Bug 101829 has been marked as a duplicate of this bug. ***
Comment 7 Frederic Fusier CLA 2005-07-25 02:44:47 EDT
*** Bug 104419 has been marked as a duplicate of this bug. ***
Comment 8 Jens Elkner CLA 2005-07-25 11:50:16 EDT
Please re-open this bug since it is really annoying!
Comment 9 Reinier Zwitserloot CLA 2005-07-25 12:39:42 EDT
As per earlier instructions, bug has been re-opened as 3.1 final is out.
Comment 10 Frederic Fusier CLA 2005-07-25 14:26:00 EDT
Reinier,
Bug status is set by team member and should not modified by users.
As they are now several duplicate for this bug, there would be high chance that
we reopened it, but please let us making our plan for next release and change it
by ourself...
Instead, you'd better increase severity to let us know that this bug seems to be
more important for users than it was when you opened it.
Thanks
Comment 11 Frederic Fusier CLA 2005-07-25 14:28:58 EDT
*** Bug 104419 has been marked as a duplicate of this bug. ***
Comment 12 Frederic Fusier CLA 2005-07-26 08:51:55 EDT
Reiner,
You did the right thing reopening this bug as I asked you to do it in comment 5...
My fault, I thought you did it after comment 8 request.
Forget my previous comment and sorry for confusion.
Comment 13 Frederic Fusier CLA 2005-07-26 08:55:17 EDT
Increase severity as this issue is really annoying for some users (see bug 104419).

Comment 14 Frederic Fusier CLA 2006-03-24 06:42:20 EST
Created attachment 36881 [details]
Patch to fix this issue

This patch can be applied on top of JDT/Core v_648 version...

Need to verify that there's no performance impact before releasing this change...
Comment 15 Frederic Fusier CLA 2006-03-24 06:58:47 EST
Philippe, what's your mind about this change?
Comment 16 Frederic Fusier CLA 2006-04-04 10:10:15 EDT
Fix is not valid: it would be better to browse scopes until top level and rely on binding instead of looking at modifiers and add a new field...

Unfortunately 3.2 endgame plan too short to continue and implement this new version, so I add to defer this fix again to next version.
Comment 17 Frederic Fusier CLA 2007-06-21 11:00:44 EDT
Reopen as LATER is deprecated...
Comment 18 Eric Jodet CLA 2007-08-29 06:17:42 EDT
*** Bug 87500 has been marked as a duplicate of this bug. ***
Comment 19 Eric Jodet CLA 2007-08-31 04:45:22 EDT
Created attachment 77448 [details]
patch + test case

Jerome, Frederic: may you please review proposed patch - thanks
Comment 20 Frederic Fusier CLA 2007-08-31 06:54:38 EDT
(In reply to comment #19)
> Created an attachment (id=77448) [details]
> patch + test case
> 
> Jerome, Frederic: may you please review proposed patch - thanks
> 
ProblemReporter.javadocMissing(...) is unnecessarily called when severity == ProblemSeverities.Ignore.
Otherwise, it's OK for me
Comment 21 Eric Jodet CLA 2007-08-31 07:11:37 EDT
Created attachment 77452 [details]
patch + test case

(In reply to comment #20)
improved version + code factorization as suggested by Jerome.
Comment 22 Jerome Lanneluc CLA 2007-08-31 09:48:46 EDT
(In reply to comment #21)
Patch looks good to me, so +1 for this patch
Comment 23 Frederic Fusier CLA 2007-09-28 09:15:10 EDT
(In reply to comment #22)
> (In reply to comment #21)
> Patch looks good to me, so +1 for this patch
> 
Also +1 for this patch
Comment 24 Eric Jodet CLA 2007-10-04 09:09:43 EDT
Released for 3.4M3 in HEAD stream
Comment 25 David Audel CLA 2007-10-29 08:18:44 EDT
Verified for 3.4M3 using I20071029-0010 build.