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.
Consider the following: public int foo() { final int r = 123; BooleanSupplier x = () -> { return true; }; return r; } This method while useless illustrates that netbeans will provide the hint for `r' that "The assigned value is never used". This is due to the return statement in the lambda expression. Note that even though the return types are different there is no actual error produced, just the invalid warning. A non block form will not produce this incorrect hint as it does not contain the return statement explicitly: public int foo() { final int r = 123; BooleanSupplier x = () -> true; return r; }
Should be fixed in jet-main#9bc57d4748dd
Integrated into 'main-silver', will be available in build *201401310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9bc57d4748dd User: Svata Dedic <sdedic@netbeans.org> Log: #241034: isolated lambda bodies the same way as methods, test added