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.

Bug 256749

Summary: False positive of warning "null" in Loop assignment
Product: java Reporter: SirIntellegence
Component: HintsAssignee: 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

Description SirIntellegence 2015-11-23 19:12:36 UTC
Created attachment 157462 [details]
Test file

It thinks the variable could be null when we are checking that it is not null.
Comment 1 Svata Dedic 2015-11-23 19:37:17 UTC
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 :-/