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.
This is a follow up of issue 262212. Now when I use the great code completion support and generate a lamda, I get: $("x").addClass((p1, p2) -> { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. }); however this is wrong. While it may make sense to generate "throw new UOE" in case of implementing multiple methods in regular interfaces, it makes no sense in case of lamdas: Lamda has only one method and it is clear that once I decide to use lamda, I want to implement it, so rather than the current "throw new UOE" I would find more appropriate to get real code, for example: $("x").addClass((p1, p2) -> { return null; }); in the case of the above JQuery API.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/575c477b31d1
Integrated into 'main-silver', will be available in build *201609020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/575c477b31d1 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #262230 - Lamdas shouldn't throw exceptions when generated - fixed.
Thanks. The feature seems to work in regular Java files.