Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369901

Summary: Change global compiler settings for project builds to enforce NPE analysis introduced with ecj in 3.8M4
Product: [Eclipse Project] Platform Reporter: Andrey Loskutov <loskutov>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: deepakazad, kim.moir
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Andrey Loskutov CLA 2012-01-27 02:40:39 EST
Build Identifier: 3.8

There is a great new NPE analysis feature added to the Eclipse compiler (ecj) in the 3.8 M4. 
See bug 186342, http://eclipseandjazz.blogspot.com/2011/12/inter-procedural-null-analysis-using.html and http://blog.deepakazad.com/2012/01/weird-code-pattern-in-eclipse-sdk.html

Not sure how the current releng build specifies the java compiler settings, but it would be very valuable to enable the "NPE" warnings introduced with bug 186342 for *all* projects contributing to the 3.8 release.

Going one step further, after enabling those warnings and making people informed I would even wish that those compiler warnings should be turned to compile *errors* in some future release cycle. I know that this could break the build, but this is the easiest way to make people aware about "hidden gems" in the code. 

Regards,
Andrey

Reproducible: Always
Comment 1 Deepak Azad CLA 2012-01-27 05:39:40 EST
(In reply to comment #0)
> Not sure how the current releng build specifies the java compiler settings, but
> it would be very valuable to enable the "NPE" warnings introduced with bug
> 186342 for *all* projects contributing to the 3.8 release.

We (JDT team) set the default of a compiler option to warning (or error as deemed appropriate), when we are satisfied that the option will not produce many false positives. The builder for Eclipse SDK then automatically uses these default options.
Comment 2 Kim Moir CLA 2012-01-30 10:29:01 EST
Thanks Deepak for the comment. Closing.