Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 419807 - [Dialogs] AIOOB exception in AbstractElementListSelectionDialog
Summary: [Dialogs] AIOOB exception in AbstractElementListSelectionDialog
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.5 M6   Edit
Assignee: Noopur Gupta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 388520 443872 444520 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-18 03:23 EDT by Noopur Gupta CLA
Modified: 2015-02-20 04:42 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2013-10-18 03:23:01 EDT
package com.test;

public class A1 {
	Map<String, List<Document>> files;
}
----------------------

Paste the above example (make sure no import is added) in a Java Project with 1.8 JRE System library (8b108 or above).

Press Ctrl+Shift+O to organize imports (for Document, List, Map).

In the wizard, the page for 'Document' selection will have 3 entries:
org.w3c.dom.Document, javax.swing.text.Document, com.sun.xml.internal.txw2.Document.

Select the 3rd entry (whichever it is) and click Next => We get AIOOB exception in the Error Log view:

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 2
	at org.eclipse.ui.dialogs.FilteredList.getSelection(FilteredList.java:439)
	at org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.getSelectedElements(AbstractElementListSelectionDialog.java:261)
	at org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.updateOkState(AbstractElementListSelectionDialog.java:491)
	at org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.handleElementsChanged(AbstractElementListSelectionDialog.java:195)
	at org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.setListElements(AbstractElementListSelectionDialog.java:179)
	at org.eclipse.jdt.internal.ui.dialogs.MultiElementListSelectionDialog.setPageData(MultiElementListSelectionDialog.java:291)
	at org.eclipse.jdt.internal.ui.dialogs.MultiElementListSelectionDialog.turnPage(MultiElementListSelectionDialog.java:282)
	at org.eclipse.jdt.internal.ui.dialogs.MultiElementListSelectionDialog.buttonPressed(MultiElementListSelectionDialog.java:204)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:633)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4351)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
	at org.eclipse.jface.window.Window.open(Window.java:803)
	at org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.open(AbstractElementListSelectionDialog.java:441)
	at org.eclipse.jdt.internal.ui.dialogs.MultiElementListSelectionDialog.open(MultiElementListSelectionDialog.java:111)
	at org.eclipse.jdt.ui.actions.OrganizeImportsAction.doChooseImports(OrganizeImportsAction.java:357)
...
Comment 1 Paul Webster CLA 2013-10-18 09:09:16 EDT
*** Bug 388520 has been marked as a duplicate of this bug. ***
Comment 2 Markus Keller CLA 2014-09-11 17:04:52 EDT
*** Bug 443872 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2015-02-18 03:13:38 EST
New Gerrit change created: https://git.eclipse.org/r/42095
Comment 5 Dani Megert CLA 2015-02-19 04:19:50 EST
.
Comment 6 Noopur Gupta CLA 2015-02-20 04:42:25 EST
*** Bug 444520 has been marked as a duplicate of this bug. ***