Project: JDT
Bug 367669 IAE during setRawClasspath(..) due to missing link to external
Reported: 2011-12-30 13:51:25 | Status: resolved fixed

In the Object Teams tests I'm intermittently seeing the following exception: java.lang.IllegalArgumentException: Element not found: /.org.eclipse.jdt.core.external.folders/.link15. at org.eclipse.core.internal.watson.ElementTree.elementNotFound(ElementTree.java:256) at org.eclipse.core.internal.watson.ElementTree.createElement(ElementTree.java:184) at org.eclipse.core.internal.resources.Workspace.createResource(Workspace.java:1369) at org.eclipse.core.internal.resources.Workspace.createResource(Workspace.java:1322) at org.eclipse.core.internal.localstore.RefreshLocalVisitor.createResource(RefreshLocalVisitor.java:80) at org.eclipse.core.internal.localstore.RefreshLocalAliasVisitor.createResource(RefreshLocalAliasVisitor.java:38) at org.eclipse.core.internal.localstore.RefreshLocalVisitor.synchronizeExistence(RefreshLocalVisitor.java:219) at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:293) at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:110) at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:920) at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:904) at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1694) at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:711) at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:647) at org.eclipse.jdt.internal.core.ExternalFoldersManager.createLinkFolder(ExternalFoldersManager.java:153) at org.eclipse.jdt.internal.core.ExternalFoldersManager.createLinkFolder(ExternalFoldersManager.java:145) at org.eclipse.jdt.internal.core.ExternalFolderChange.updateExternalFoldersIfNecessary(ExternalFolderChange.java:48) at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:62) at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:74) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3147) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3109) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:3162) I suspect that the missing linked resource corresponds to a classpath container. The container initializer uses a path obtained using these steps: installDirectory = bundle.getEntry("/") -> yields s.t. like bundleentry://537.fwk23545827/ FileLocator.toFileURL(installDirectory).getPath() -> yields an absolute path into the area at configuration/org.eclipse.osgi/bundles/537/2/.cp/ At a closer look the above scheme is more complicated than needed and I'm hoping to work around the issue by an easier scheme. Still the IAE looks suspicious to me.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/jarexport/PlainJarExportTests.java