Summary: | [compiler][options][null] Set "Null pointer access" to warning by default | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | John Arthorne <john.arthorne> | ||||||||
Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P2 | CC: | kent_johnson, Olivier_Thomann, philippe_mulet | ||||||||
Version: | 3.3 | Flags: | kent_johnson:
review+
|
||||||||
Target Milestone: | 3.4 M3 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
John Arthorne
2007-06-15 09:52:39 EDT
John, the decision is with Philippe. My understanding is that, as our confidence in our null analysis support grows, we make incremental efforts to boost its adoption, and that this is a gradual approach. As a first significant step, org.eclipse.jdt.core itself has been using a level of Warning for the 'Null pointer access' setting since the 24th of April, and has no such warning left. I would still drag your attention to the following caveats: - our null analysis implementation is subject to drastic constraints that are justified by our continued preference for high performance; this is responsible for more than one outstanding bug that we haven't resolved yet; - some of these might remain unresolved if we cannot come up with a reasonable solution in terms of cost and performance; - the last bug I fixed in that area is quite recent. All in all, while we made progress and while the feature is already useful, we felt it was not mature enough to make it as a default in 3.3 timeframe. Philippe, would you please comment re. plans as you see them? Fair enough. My feedback is that I've run it over some large code bases (most of Eclipse source, all of Jazz source), and it found some really good bugs. I didn't find any false positives (although the potential null reference check still has some false positives). It's a catch-22 - you won't get much feedback/testing if it's off by default. Moving to Philippe for further discussion and decision. +1 for enabling it by default in 3.4 stream. Raising priority. Created attachment 80232 [details]
Fix + preliminary changes for test cases
This fix add NullReference to the warning threshold in CompilerOptions, changes the javadoc for JavaCore.defaultOptions, and changes one of the test cases. Tests under way for tests that will be broken by the change (expecting a few at least).
Created attachment 80340 [details]
Fix + test cases
Two more changes to tests (the default option being hit by them). Changed two initializations like X x = null; to X x = new X();.
Kent, could you please review this? I guess the print usage of the batch compiler should also be updated + the corresponding BatchCompilerTest. Created attachment 80561 [details]
Fix + test cases
Better patch: addresses Olivier's insights (changed the batch compiler help message and a log contents, added tests that illustrate the new default - aka warning is on by default and can be disabled).
Released for 3.4M3 Verified for 3.4M3 using I20071029-0010 build. |