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 225970 - False unnecessary null test hint
Summary: False unnecessary null test hint
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Lahoda
Depends on:
Reported: 2013-02-11 09:25 UTC by gualtiero65
Modified: 2013-06-22 05:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

IDE log (59.53 KB, text/plain)
2013-02-11 09:26 UTC, gualtiero65
Netbeans screen shot (17.25 KB, image/png)
2013-02-11 09:28 UTC, gualtiero65
Class source file (374 bytes, application/octet-stream)
2013-02-11 09:30 UTC, gualtiero65

Note You need to log in before you can comment on or make changes to this bug.
Description gualtiero65 2013-02-11 09:25:50 UTC
Product Version = NetBeans IDE 7.3 RC2 (Build 201302050851)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_13
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01

The "unnecessary null test" hint is unfluenced by the @javax.annotation.Notnull annotation.
The following code:

public void showBug2(@javax.annotation.Nonnull String str) {
        assert str != null;

generates a false hint message on the assert line while it should not.
By removing the annotation on the str parameter, the hint message disappears.
Comment 1 gualtiero65 2013-02-11 09:26:05 UTC
Created attachment 131227 [details]
IDE log
Comment 2 gualtiero65 2013-02-11 09:28:57 UTC
Created attachment 131228 [details]
Netbeans screen shot

The image show the flase message hint on the second method while the first one, without annotation, does not have any hint messages.
Comment 3 gualtiero65 2013-02-11 09:30:00 UTC
Created attachment 131229 [details]
Class source file
Comment 4 Quality Engineering 2013-06-22 02:08:53 UTC
Integrated into 'main-golden', will be available in build *201306212301* on (upload may still be in progress)
User: Jan Lahoda <>
Log: #225970: making null pointer check ignore precondition checks.
Comment 5 Jan Lahoda 2013-06-22 05:28:09 UTC
The check should be ignoring typical "precondition checks" after the above changeset.