Bug 372013 - [preferences] option to turn on warnings for missing null default annotation
Summary: [preferences] option to turn on warnings for missing null default annotation
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 372012
Blocks:
  Show dependency tree
 
Reported: 2012-02-20 05:55 EST by Ayushman Jain CLA
Modified: 2012-03-07 08:39 EST (History)
5 users (show)

See Also:


Attachments
proposed fix (6.72 KB, patch)
2012-03-02 09:06 EST, Ayushman Jain CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2012-02-20 05:55:19 EST
A new option is needed for bug 372012 to alert a user when no default annotation has been specified on a package/type, so that he can add those deaults manually. 

This is necessitated by the fix for bug 366063.
Comment 1 Srikanth Sankaran CLA 2012-02-20 06:30:27 EST
This is in lieu of the current

[x] Use non-null as the workspace wide default

and 

[x] Use non-null as the project wide default,

which we are finding is impossible to support in a compatible manner.

See Markus' comment https://bugs.eclipse.org/bugs/show_bug.cgi?id=366063#c11 passage beginning with 

"Maybe we should just remove the default setting
from the project or turn it into a warning"
Comment 2 Markus Keller CLA 2012-02-20 07:15:13 EST
Proposed checkbox label:
[ ] Missing NonNullByDefault annotation
Comment 3 Srikanth Sankaran CLA 2012-02-20 07:21:59 EST
(In reply to comment #2)
> Proposed checkbox label:
> [ ] Missing NonNullByDefault annotation

Shouldn't this be a bit more verbose ?  As in :

[ ] Warn if NonNullByDefault annotation is missing at package level
    (for named packages) and at top level types (for default package)
Comment 4 Ayushman Jain CLA 2012-02-20 08:19:49 EST
(In reply to comment #2)
> Proposed checkbox label:
> [ ] Missing NonNullByDefault annotation

Instead of checkbox we should just make it an error/warning/ignore preference, no? Maybe the verbosity proposed by Srikanth won't be needed then.
Comment 5 Markus Keller CLA 2012-02-20 08:27:24 EST
The complete description is good for the help page, but the option label
shouldn't be too long. Otherwise, you'd have to read yourself to death.

We can expand it to "Missing NonNullByDefault annotation on package", but the
default package is really a corner case that belongs to the manual.

> Instead of checkbox we should just make it an error/warning/ignore preference
Yes.
Comment 6 Markus Keller CLA 2012-02-20 08:52:49 EST
To align with other existing options, the formatting should be:

Missing '@NonNullByDefault' annotation on package:  Error/Warning/Ignore
Comment 7 Ayushman Jain CLA 2012-03-02 09:06:16 EST
Created attachment 211960 [details]
proposed fix
Comment 8 Deepak Azad CLA 2012-03-07 04:32:34 EST
I released the patch, as it looks reasonable and it also fixes the compile errors in o.e.jdt.ui caused by fix for bug 372012.

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=a4197b7003e6d51f86fb5968a0bc300c863830ca
Comment 9 Markus Keller CLA 2012-03-07 08:39:23 EST
Thanks Deepak.