Bug 70158 Exception trying to add getter [code manipulation]
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)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/SourceActionDialog.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.dialogs;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;