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.
When I open my project (https://github.com/kelemen/netbeans-gradle-project), NetBeans shows compiler error in a lot of places. The error seems to be related to inferring generic argument. Everything is fine in 8.1.
After a discussion with Wade Chandler, we came to the conclusion that the issue happens when using JDK 7 (maybe even 6, did not check this). It cannot be reproduced when the opened project is set to use JDK 8.
The issue can be simply reproduced by putting a class like this into a project (I have tried it with Maven and Gradle) after setting the project to use JDK 7 (and source level 7). <pre> package org.netbeans.fewgrdnfntf; import java.util.*; public final class NewClass { public static void main(String[] args) { Collection<? extends Runnable> src = null; Collection<Runnable> dest = new ArrayList<>(src); } } </pre>
This issue still exists if I build NB from the sources and it blocks me from upgrading NB from 8.1 and as it stands it will still block me in NB 9. Altough the previously mentioned example works if I build NB from the sources, however there are still various (more complex) examples where it fails (despite that the code compiles fine). For example: import java.util.Collection; import java.util.List; import java.util.function.Supplier; import java.util.stream.Collectors; public final class NewClass { private static <E extends Throwable> List<TestFactory<E>> test( Collection<? extends Supplier<? extends E>> factory) { return factory.stream() .map(NewClass::testMap) .collect(Collectors.toList()); } private static <E extends Throwable> TestFactory<E> testMap(Supplier<? extends E> factory) { return null; } private static interface TestFactory<E extends Throwable> { } }
Created attachment 164502 [details] no-red-marks-at-all
See the pic in the attachment above. No red marks at all. In a Maven project. My environment: Product Version: NetBeans IDE 8.2 (Build 201705191307) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2 Java: 1.8.0_121; Java HotSpot(TM) 64-Bit Server VM 25.121-b13 Runtime: Java(TM) SE Runtime Environment 1.8.0_121-b13 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\gwieleng\AppData\Roaming\NetBeans\8.2 Cache directory: C:\Users\gwieleng\AppData\Local\NetBeans\Cache\8.2
Created attachment 164503 [details] red-line-1.png
Created attachment 164504 [details] red-line-2.png
The issue is exactly what is shown in Geertjan's screenshot. The code compiles fine but NB still flags it as an error.
Yes, I can reproduce this. A related issue is that we need to figure out in the context of Apache, since nb-javac will not be donated to Apache, how we can work on code in nb-javac, i.e., where it will be hosted, where we can file issues, and how/if we can work on it together.