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 Dev (Build 20131216-4771df8de272) VM: Java HotSpot(TM) Client VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11 OS: Linux User Comments: hmichel: Selected hint 'Use functional operation' xehpuk: I tried to apply the hint "Can use functional operations" on a for-each loop. mklaehn: applied Hint "Use functional methods" to for (final MyObject mo : lookup.lookupAll(MyObject.class) {} GUEST: I right clicked on the warning lightbulb next to my iterator code and clicked where it said "can use functional operation >" Stacktrace: java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.elementData(ArrayList.java:371) at java.util.ArrayList.get(ArrayList.java:384) at org.netbeans.modules.java.hints.jdk.mapreduce.Refactorer.isRefactorable(Refactorer.java:99) at org.netbeans.modules.java.hints.jdk.mapreduce.ForLoopToFunctionalHint$FixImpl.performRewrite(ForLoopToFunctionalHint.java:102) at org.netbeans.spi.java.hints.JavaFix$1.process(JavaFix.java:193) at org.netbeans.modules.java.hints.spiimpl.JavaFixImpl$1.run(JavaFixImpl.java:103)
Created attachment 143231 [details] stacktrace
Fixed in jet-main#28aef254f6ef
Integrated into 'main-silver', will be available in build *201401220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/28aef254f6ef User: Svata Dedic <sdedic@netbeans.org> Log: #239542: avoid exc. on empty blocks
*** Bug 240544 has been marked as a duplicate of this bug. ***