Project: JDT
Bug 70158 Exception trying to add getter [code manipulation]
Reported: 2004-07-15 16:17:50 | Status: verified fixed

I got the following exception trying to add a getter for an instance variable to a class. I choose the instance variable and ran Source/Generate Getters and Setters, deselected the setter and clicked OK. The oepration failed with the following exception. This is with Eclipse 3.0 and I have the entire source for Eclipse SDK loaded from CVS (in case it matters). java.lang.IndexOutOfBoundsException: Index: 5, Size: 5 at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.util.ArrayList.RangeCheck(ArrayList.java) at java.util.ArrayList.get(ArrayList.java) at org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog.getElementPosition (SourceActionDialog.java:562) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run (AddGetterSetterAction.java:276) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.run (AddGetterSetterAction.java:486) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java) at org.eclipse.jface.action.Action.runWithEvent(Action.java) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:915) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent (ActionContributionItem.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:59) at java.lang.reflect.Method.invoke(Method.java:390) at org.eclipse.core.launcher.Main.basicRun(Main.java:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SourceActionDialog.java