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 229490 - "Never Null" hint shown incorrectly
Summary: "Never Null" hint shown incorrectly
Status: RESOLVED DUPLICATE of bug 227745
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-08 00:08 UTC by mclaborn
Modified: 2013-05-15 14:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot of problem (15.74 KB, image/png)
2013-05-08 00:08 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2013-05-08 00:08:08 UTC
Product Version = NetBeans IDE 7.3 (Build 201302132200)
Operating System = Linux version 3.2.0-41-generic running on amd64
Java; VM; Vendor = 1.7.0_10
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.6-b04

Given the code below, the last "l_err == null" shows this hint: "Unnecessary test for null - the expression is never null".  
This is incorrect, as there a many situations in which l_err will be null.


    String l_err = null;
    if (StringUtil.isEmpty(a_row.optString(DELIVERYDATE))) {
      l_err = "Delivery date missing";
    }
    if (l_err == null && a_row.opt(FLOCKOWNER) == null) {
      l_err = "Flock missing";
    }
    if (l_err == null && StringUtil.isEmpty(a_row.optString(ACTION))) {
      l_err = "Action missing";
    }
Comment 1 mclaborn 2013-05-08 00:08:46 UTC
Created attachment 134211 [details]
screen shot of problem
Comment 2 Jiri Prox 2013-05-15 14:37:10 UTC

*** This bug has been marked as a duplicate of bug 227745 ***