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.

Bug 239542 - ArrayIndexOutOfBoundsException: -1
Summary: ArrayIndexOutOfBoundsException: -1
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 240544 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-17 00:55 UTC by Michel Graciano
Modified: 2014-02-07 17:45 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 204154


Attachments
stacktrace (2.30 KB, text/plain)
2013-12-17 00:55 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2013-12-17 00:55:19 UTC
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)
Comment 1 Michel Graciano 2013-12-17 00:55:21 UTC
Created attachment 143231 [details]
stacktrace
Comment 2 Svata Dedic 2014-01-20 09:21:30 UTC
Fixed in jet-main#28aef254f6ef
Comment 3 Quality Engineering 2014-01-22 02:34:28 UTC
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
Comment 4 Svata Dedic 2014-02-07 17:45:06 UTC
*** Bug 240544 has been marked as a duplicate of this bug. ***