| Summary: | [validation] validation doesn't handle redundant null checks and null point access detection correctly | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Sven Asp <asp.sven> | ||||
| Component: | General | Assignee: | Chris Jaun <cmjaun> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | Chris Jaun <cmjaun> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ccc, cmjaun | ||||
| Version: | 3.2 | ||||||
| Target Milestone: | Future | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 169936 [details]
Complete project with preference settings
Sven, judging by the build identifier, I believe you are using a Helios build. Helios (Eclipse 3.6) corresponds to WTP 3.2. If that is not correct, please let us know. Yes I'm using 3.6 and everything is checked out from Helios. The IDE and other stuff that is in sync. I think these checks are no longer available in 3.2.4 and 3.3. Chris, please keep this test case in mind for when you go back to fix and enable them. Most code analysis validation has been disabled and more is likely to be. These error messages are gone and won't be coming back, so closing this bug. |
Build Identifier: I20100513-1500 The details are best explained by looking at the comments in this code (attached as project with project specific settings). function getfoo() { return null; } function check1() { var foo = null; // The condition in the if statement should be flagged // as a redundant null check. That doesn't happen if(foo == null) { // This is correctly flagged as a null pointer // access foo.doSomething(); } } function check2() { var foo = getfoo(); if(foo == null) { // This is NOT flagged as a null pointer // access although it really should be. foo.doSomething(); } } function check3() { var foo = null; // The condition in the if statement should be flagged // as a redundant null check. That doesn't happen if(foo != null) { // This is incorrectly flagged as a null pointer // access. foo cannot be null at this location. // This is in fact dead code but is not flagged // as such. foo.length(); } } Reproducible: Always