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 Dev (Build 201606020002) Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14 Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14 System: Windows 10 version 10.0 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev 1. Create a new Maven project containing the following code: -------- import java.util.List; import java.util.function.BiConsumer; import java.util.function.BinaryOperator; import java.util.function.Supplier; import java.util.stream.Collector; public class Main { public static class Parent<T, A, R> { private final Supplier<A> supplier = null; } public static class Child<T, A extends List<T>, R extends List<T>> extends Parent<T, A, R> { public void run() { BiConsumer<A, T> accumulator = (list, element) -> { list.add(element); }; BinaryOperator<A> combiner = (left, right) -> { left.addAll(right); return left; }; Collector.of(supplier, accumulator, combiner); } } } -------- 2. Netbeans highlights the last line with a compiler error. 3. When the mouse hovers over the compiler error, the following tooltip is displayed: -------- no suitable method found for of(Supplier<A#1>,BiConsumer<A#2,T#1>,BinaryOperator<A#2>) <followed by 20 confusing lines> -------- 4. But in fact, javac reports the following errors: -------- Main.java:[28,26] supplier has private access in com.mycompany.misleadinggenericerror.Main.Parent Main.java:[28,22] no suitable method found for of(java.util.function.Supplier<A>,java.util.function.BiConsumer<A,T>,java.util.function.BinaryOperator<A>) <followed by 20 confusing lines> -------- 5. The second error message is extremely cryptic and leads to hours of confusion. The first error message is perfectly clear. The fact that Netbeans lists the second error message and completely omits the first is extremely bad. Prioritizing accordingly.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/f035804f74f1
Dusan, This bug was marked as fixed last week but it doesn't seem to have made it into 201606130002 (today's build). Is something blocking the merge?
In build 201606200002, I get the right error message if I hover over "supplier" but if I hover over the method invocation "Collector.of()" or any of the subsequent arguments I still get the wrong error message. I am expecting users to get the same (first) message regardless of which element they are hovering over.
Unfortunately, this is as designed behaviour. Error messages are displayed when mouse hovers over their spans. The error message 'supplier has private access in com.mycompany.misleadinggenericerror.Main.Parent' is related to the usage of the 'supplier' identifier and its span is defined from the beginning to the end of the identifier. On the other hand, the message 'no suitable method found ...' is related to the corresponding method invocation and spans over it.
Good point. I filed #262550 to cover this point. Feel free to provide more details (and/or ideas) if you have any.