Bug 249342 - [build path] IndexOutOfBoundsException attempting to remove last build path entry
Summary: [build path] IndexOutOfBoundsException attempting to remove last build path e...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-01 11:57 EDT by Jerome Lanneluc CLA
Modified: 2009-05-20 08:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2008-10-01 11:57:43 EDT
I20080930-0921 + fix for bug 249321

1. New workspace
2. New Java Project
3. Edit .classpath to add a ".." lib entry (pointing at an existing library),
e.g.
        <classpathentry kind="lib" path="../../test/JUnit "/>
4. In Package Explorer, select the library under Referenced Library
5. Build path > Remove from buildpath
Observe: You get the following exception in the .log:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:546)
	at java.util.ArrayList.get(ArrayList.java:321)
	at org.eclipse.jdt.internal.corext.buildpath.CPJavaProject.getJavaProject(CPJavaProject.java:77)
	at org.eclipse.jdt.internal.corext.buildpath.ClasspathModifier.commitClassPath(ClasspathModifier.java:1058)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.RemoveFromBuildpathAction$1.run(RemoveFromBuildpathAction.java:153)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:446)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
	at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1191)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.RemoveFromBuildpathAction.run(RemoveFromBuildpathAction.java:173)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3848)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3446)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:333)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:370)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Comment 1 Jerome Lanneluc CLA 2008-10-01 12:28:20 EDT
The problem is not because of the ".." library. I got this exception because this was the last entry in my .classpath file.
Comment 2 Jerome Lanneluc CLA 2008-10-01 12:31:20 EDT
So the exact steps are:
1. New workspace
2. New Java Project
3. Edit .classpath to remove existing entries
4. Add a ".." lib entry (pointing at an existing library), e.g.
       <classpathentry kind="lib" path="../../test/JUnit "/>
5. In Package Explorer, select the library under Referenced Library
6. Build path > Remove from buildpath
Observe: You get the IOOBE
Comment 3 Dani Megert CLA 2008-10-01 12:41:24 EDT
Fixed in HEAD.
Available in builds > N20081001-2000.
Comment 4 Dani Megert CLA 2009-05-20 08:06:37 EDT
Verified in 3.5 RC1.