Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 225970 - False unnecessary null test hint
False unnecessary null test hint
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Hints
7.3
PC Windows 7
: P3 (vote)
: 7.4
Assigned To: Jan Lahoda
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-11 09:25 UTC by gualtiero65
Modified: 2013-06-22 05:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


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

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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/af654455806b
User: Jan Lahoda <jlahoda@netbeans.org>
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.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo