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.
Created attachment 103087 [details] Editor screenshot The following applies to NB 7 beta. Consider the given code example. It works with javac from JDK7 b118, but fails when compiling from NB (even if platform and binary compatibility are set to JDK7, and platform path really points to JDK7 b118). NOTE 1: It is probable related to a javac bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996914 This bug does NOT apply here, but seems to me very similar. NOTE 2: The error is also displayed in the NB editor. Should it be a separated bug report for the editor? NOTE 3: I made it P2 because an error is displayed+compiled where none exists. = = = = = = = = = = CODE = = = = = = = = = = import java.nio.file.*; import java.util.concurrent.*; public class _NBFormattingRegression2 { static abstract class MyCallable<V> implements Callable<V> { } public static void main(String... args) { // WORKS Callable<String> c = new MyCallable<String>() { @Override public String call() { return null; } }; // ERROR: cannot infer type arguments for SimpleFileVisitor<> FileVisitor<Path> fv = new SimpleFileVisitor<Path>() { }; } }
Should be fixed in current dev build. See http://hg.netbeans.org/main-silver?cmd=changeset;node=1bbdf313ff1b
Well, the bug is still there in NB 2010-11-25. Do I have to wait till the mentioned javac bug is fixed? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6996914 (The bug is marked with b120, currently released is b119)
OOPS - source level should be set to 1.7 and the 'Can Use Diamond' hint has to be enabled to reproduce.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/ba752122555f http://hg.netbeans.org/main/nb-javac/rev/0deb9a1bdfb9
Integrated into 'main-golden', will be available in build *201011270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ba752122555f User: Dusan Balek <dbalek@netbeans.org> Log: Issue #192146: Cannot infer type arguments for [...] even if type argument is specified - fixed.