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 271823 - False positive of "Non-null method returns null"
Summary: False positive of "Non-null method returns null"
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-16 21:08 UTC by SirIntellegence
Modified: 2017-12-12 18:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample code (245 bytes, text/plain)
2017-11-16 21:08 UTC, SirIntellegence
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2017-11-16 21:08:59 UTC
Created attachment 165462 [details]
Sample code

You have a lambda passed into another (@NonNull) method that is providing a return value for the current @NonNull method. If the lambda returns null, you get a warning that you are returning null in a @NonNull method. See sample code for details.
Comment 1 dtrebbien 2017-11-23 01:41:06 UTC
I have created a Pull Request to fix this issue here: https://github.com/apache/incubator-netbeans/pull/287
Comment 2 dtrebbien 2017-11-23 01:42:18 UTC
By the way, thank you for providing a minimal test case!
Comment 3 SirIntellegence 2017-12-08 19:19:33 UTC
You are welcome. I have determined that bugs get fixed faster if I do provide one.
Comment 4 dtrebbien 2017-12-12 18:40:12 UTC
PR 287 has been merged. Closing as fixed.