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 153351 - Null checks and redundant null checks.
Summary: Null checks and redundant null checks.
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2008-11-18 01:23 UTC by elberry
Modified: 2014-08-20 07:39 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description elberry 2008-11-18 01:23:36 UTC
One feature I miss from IntelliJ and Eclipse is the null pointer access and redundant null check warnings.

Example code:
public class Main {

    public static void main(String[] args) {
        String test = null;
        if(test != null) {


In NetBeans this code produces no warnings. However in Eclipse, this code produces two warnings. The first points out
that "test" in "test.startsWith("oops");" is accessing a null object and thus shows a warning about a looming nullpointer. 

The second points out "test" in "if(test != null) {" as a redundant null check since I've already used test above the
"if" check as if it wasn't null.

I really miss this feature since it helps keep the code clean, and I'd love to see this in NetBeans.

Comment 1 skiwi 2014-08-20 07:39:39 UTC
This issue is still marked as New, I believe this has been fixed since a few years.