| Summary: | Warning for possible NullPointerException | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Prashant Deva <prashant.deva> |
| Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | akiezun |
| Version: | 3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The compiler should give a warning when it sees a possible null pointer exception. Eg- public void asd(MyObj a) { if(a!=null) a.doSomething(); a.doSomething(); //warning here } Basically it should check if some var is checked for null. If it is, and there is some portion of the code which exccutes code on that var without checking it for null then there can be a possible nullpointer excpetion. For example this wont produce warning in the following code as no check for null is done- public void asd(MyObj a) { a.doSomething(); // NO warning here }