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.
Summary: | code hints get confused by lambda expressions | ||
---|---|---|---|
Product: | java | Reporter: | athompson <athompson> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | athompson |
Priority: | P2 | ||
Version: | Dev | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | incorrect code hint shown |
*lambda Can you please evaluate this problem ASAP? Thanks! Does this happen in development build only or also in 8.2 Release Candidate? Confirmed; generally these types of defect are classified P3. The NPE analysis code is quite complex; unless the fix is something very trivial (will investigate) I would not recommend fixing this issue in high resistance. Update: the defect is in a shared utility, so it potentially affects also if-to-switch conversion, Introduce Method and possibly may produce false warnings on expressions/values unused afer assignment. Fixed in trunk by jet-main#15ecebefc019 Integrated into 'main-silver', will be available in build *201609200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/15ecebefc019 User: Svata Dedic <sdedic@netbeans.org> Log: #268089: do not descend into lambda expr Yup. Thanks! |
Created attachment 162104 [details] incorrect code hint shown See the attached screenshot. In this case, the variable `nextRunTime` can clearly be NULL if the method `getNextRunTime` returns NULL. The issue seems to be the closure/lamda I'm supplying as a parameter to the method. If I replace it with an anonymous inner class hints behave correctly.