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 (Build 201310111528) Operating System = Linux version 3.13.6-200.fc20.x86_64 running on amd64 Java; VM; Vendor = 1.7.0_51 Runtime = OpenJDK 64-Bit Server VM 24.51-b03 Steps to reproduce: Paste this into a class: public static void main(String[] args) { boolean dummy = (Object[].class.isAssignableFrom(null)); } What actually happens: In NetBeans 7.4 (all builds up to and including the build listed above) this marks it as an error claiming "lambda expression not expected here". However, I can build this just fine anyway. What should happen: This doesn't get highlighted. Notes: According to http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html all lambdas have an arrow token, "->". There is nothing that even looks like that in here. This appears to be a problem with array types. If I change the statement to the following: boolean dummy = (Object.class.isAssignableFrom(null)); Then the error goes away.
Created attachment 146189 [details] IDE log
Verified that this exists in NetBeans 8.0 as well.
There's a difference in behaviour of javac from 8u20 and NB-javac. Javac from JDK 8u20 properly processes the file (even though -source 8 was explicitly provided on command line), while NB-javac produces an error "lambda expression not expected here. Also occurs in 8.0.1/dev
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/c24db16113e9 http://hg.netbeans.org/main/nb-javac/rev/6b05875de5e9
Integrated into 'main-silver', will be available in build *201408270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c24db16113e9 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #243109: IDE thinks a statement has lambda expression when it doesn't - fixed.