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.
Build: NetBeans IDE 8.2 (Build 201609300101) VM: Java HotSpot(TM) 64-Bit Server VM, 25.121-b13, Java(TM) SE Runtime Environment, 1.8.0_121-b13 OS: Windows 7 User Comments: GUEST: N/A theshadow27: Editing a Stream.flatMap functional expression Stacktrace: com.sun.tools.javac.comp.Infer$InferenceException at com.sun.tools.javac.comp.Infer.<init>(Infer.java:112) at com.sun.tools.javac.comp.Infer.instance(Infer.java:99) at com.sun.tools.javac.comp.Check.<init>(Check.java:121) at com.sun.tools.javac.comp.Check.instance(Check.java:105) at com.sun.tools.javac.comp.DeferredAttr.<init>(DeferredAttr.java:105) at com.sun.tools.javac.comp.DeferredAttr.instance(DeferredAttr.java:97)
Created attachment 164192 [details] stacktrace
exact code being edited was: private void buildKeyTable(Collection<Processor<K,V>> processors){ final long when = time(); processors.stream().flatMap((p) -> { InitialSnapshot snap = new InitialSnapshot(when, p); p.accept(snap); return snap.getKeys()###CURSOR HERE###; }).forEach((snap) -> { snap.getKeys().forEach((k)->key(k).needsUpdate(when)); }); } I had changed processors.stream().map(... to processors.stream().flatMap(... in anticipation of writing "return snap.getKeys().stream()" instead of "return snap;" that the generator had produced This was automatically refactored from a for(final Processor<K,V> p : processors) {...} using the gutter hint: ------------ From -------------- private void buildKeyTable(Collection<Processor<K,V>> processors){ final long when = time(); for(final Processor<K,V> p : processors){ InitialSnapshot snap = new InitialSnapshot(when, p); p.accept(snap); snap.getKeys().forEach((k)->key(k).needsUpdate(when)); } } ------------- To -------------- private void buildKeyTable(Collection<Processor<K,V>> processors){ final long when = time(); processors.stream().map((p) -> { InitialSnapshot snap = new InitialSnapshot(when, p); p.accept(snap); return snap; }).forEachOrdered((snap) -> { snap.getKeys().forEach((k)->key(k).needsUpdate(when)); }); } ------------- Mod 1 ------------- private void buildKeyTable(Collection<Processor<K,V>> processors){ final long when = time(); processors.stream().flatMap((p) -> { InitialSnapshot snap = new InitialSnapshot(when, p); p.accept(snap); return snap; }).forEach((snap) -> { snap.getKeys().forEach((k)->key(k).needsUpdate(when)); }); } // produces all sorts of syntax errors ---------------- To cause exception -------------- (See first version of method including cursor)
Created attachment 164193 [details] stacktrace Working on test case, this is repeatable
Created attachment 164194 [details] Testcase demonstrating issue (Issue270498.java) Please find a test case demonstrating to reproduce the Exception attached. It seems to be repeatable. Product Version: NetBeans IDE 8.2 (Build 201609300101) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 1 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\Admin\AppData\Roaming\NetBeans\8.2 Cache directory: C:\Users\Admin\AppData\Local\NetBeans\Cache\8.2
Created attachment 164195 [details] stacktrace Repeatable
Created attachment 164716 [details] stacktrace I don't know why and I think sending for you is better
Created attachment 164723 [details] stacktrace It's better when sending this error!
Created attachment 165513 [details] stacktrace edited some code
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=227009