Bug 99901 - [select] AIOOBE when selecting package reference in import statement
Summary: [select] AIOOBE when selecting package reference in import statement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-14 04:09 EDT by David Audel CLA
Modified: 2005-06-16 11:25 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (1.79 KB, text/plain)
2005-06-14 05:26 EDT, David Audel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2005-06-14 04:09:45 EDT
build 3.1RC2
1) create X.java
import java.util.*;
#
public class X {
}

2) select java
3) do F3

Exception caught by SelectionEngine:
java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2470)
	at
org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:623)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:165)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:314)
	at
org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:308)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:219)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:153)
	at
org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeResolve(SelectionConverter.java:162)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:128)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:226)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
	at
org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:108)
	at org.eclipse.core.commands.Command.execute(Command.java:311)
	at
org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:459)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:781)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:828)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:550)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:493)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:117)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:910)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:868)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:853)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:881)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:877)
	at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1474)
	at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:3347)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3066)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3682)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1655)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2689)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:365)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Philipe Mulet CLA 2005-06-14 05:03:28 EDT
+1 for RC3

Dani - pls cast your vote.
Comment 2 Dani Megert CLA 2005-06-14 05:06:14 EDT
Nice coincidence: just saw this one a minute ago and wanted to suggest to fix.
+1 for 3.1 RC3.
Comment 3 David Audel CLA 2005-06-14 05:26:54 EDT
Created attachment 23038 [details]
Proposed fix
Comment 4 David Audel CLA 2005-06-14 05:31:26 EDT
Fix released and test added
  ResolveTests#testSingleNameInImport()
Comment 5 Maxime Daniel CLA 2005-06-16 10:25:50 EDT
Verified using build N20050616-0010 + JDT Core HEAD.