Project: JDT
Bug 11424 ArrayIndexOutOfBoundsException at "Expand Selection to Previous Element"
Reported: 2002-03-14 20:16:12 | Status: verified fixed

This happens with eclipse-SDK-20020312-win32.zip every time if I'm inside a method and I apply this action a few times. When the action selects the whole method block and I try the action once more, it throws this error: java.lang.ArrayIndexOutOfBoundsException at org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSelectPreviousAction.getPreviousNode(StructureSelectPreviousAction.java:44) at org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSelectPreviousAction.internalGetNewSelectionRange(StructureSelectPreviousAction.java:28) at org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSelectionAction.getNewSelectionRange(StructureSelectionAction.java:50) at org.eclipse.jdt.internal.ui.refactoring.actions.structureselection.StructureSelectionAction.run(StructureSelectionAction.java:38) at org.eclipse.jface.action.Action.runWithEvent(Action.java:466) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1420) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:692) at org.eclipse.ui.internal.Workbench.run(Workbench.java:675) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/StructureSelectionAction/A_test24.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/actions/StructureSelectionActionTests.java