This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | False positive of warning "null" in Loop assignment | ||
---|---|---|---|
Product: | java | Reporter: | SirIntellegence |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 249320 | ||
Bug Blocks: | |||
Attachments: | Test file |
The good news is that the new implemenation handles the situation correctly -- as the loop condition tests the assignment (= the variable value) for != null, the value is asserted to be non-null within loop body. The bad news is that it the new impl is still a little clumsy and not well tested :-/ |
Created attachment 157462 [details] Test file It thinks the variable could be null when we are checking that it is not null.