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.
Product Version = NetBeans IDE 7.4 Beta (Build 201307092200) Operating System = Windows 8 version 6.2 running on x86 Java; VM; Vendor = 1.8.0-ea Runtime = Java HotSpot(TM) Client VM 25.0-b41 Consider this interface: interface ConvertLambda { void foo(); static void bar() { ConvertLambda cl = () -> System.out.println("foo()"); } } NetBeans shows two hints for converting the lambda. First hint is: "Use block as the lambda's body" ("Convert lambda body to use a block rather than an expression") Resulting in this code: static void bar() { ConvertLambda cl = () -> { return System.out.println("foo()"); }; } Apparently, the "return" is wrong here. Second hint is: "Convert lambda expression to anonymous innerclass" Resulting in this code: static void bar() { ConvertLambda cl = new ConvertLambda() { public void foo() { return System.out.println("foo()"); } }; } Again, the "return" is wrong.
Integrated into 'main-silver', will be available in build *201307212300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/7375a4c11257 User: Jan Lahoda <jlahoda@netbeans.org> Log: #233100: expression based lambda's expression can have type void, make sure not to generate the return type for it.
Good catch, thanks. Fixed by the above commit.