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.
The following lines do not compile in Netbeans: java.io.File f = null; Collections.singleton(Optional.ofNullable(Optional.ofNullable(f).orElseThrow(null).getName()).orElseThrow(null)); The error is: error: unreported exception X; must be caught or declared to be thrown Collections.singleton(Optional.ofNullable(Optional.ofNullable(f).orElseThrow(null).getName()).orElseThrow(null)); where X,T are type-variables: X extends Throwable declared in method <X>orElseThrow(Supplier<? extends X>) T extends Object declared in class Optional __ No problem is reported by the standard compiler (javac 1.8.0_91). Please ignore the fact that the code makes no sense, it is just a minimal demonstration of the compile time problem. Workaround: add type hint like this: Collections.<String>singleton ...
Seems to work fine in the current dev build.