| Summary: | [typesystem.emf.ui] ProjectAnalyzer causes ResourceExceptions for linked folders | ||
|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Karsten Thoms <karsten.thoms> |
| Component: | Xpand | Assignee: | Karsten Thoms <karsten.thoms> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | benedikt.niehues, gontsaru |
| Version: | 1.0.1 | Flags: | karsten.thoms:
kepler+
|
| Target Milestone: | M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Karsten Thoms
there seems to be a general problem with linked resources... not only when loading metamodels. You will run into a similar problem when you use extensions in your runtime-workbench templates which are distributed by plugins in your development workbench It seems that I'm experiencing the same error on a Windows machine. Here is a link to the corresponding Eclipse Forum thread: http://www.eclipse.org/forums/index.php/m/757280/ Came across this bug again and think that I finally could nail it down. JDT creates this external folders project through class ExternalModelManager. This project creates links for all managed external folders. But this project does not have a Java nature, thus any method on IJavaProject will fail. I think that this project should have the Java nature enabled, so I raised Bug#394568. Until this is fixed the XtendXpandBuilder might fix the situation. Turned out that this is no JDT bug. The problem is as follows:
1) The JDTStorageFinder searches the IStorage for an Xtend file, which is on a linked folder
Folder might be e.g.
F/.org.eclipse.jdt.core.external.folders/.link1
2) IFolder#findMember() resolves this to its original location, e.g.
L/.org.eclipse.jdt.core.external.folders/.link1/<path-to-xtend-file>
3) XtendXpandProject#loadXtendXpandResource() gets this IStorage and asks the XtendResourceParser to load the Resource
ResourceContributor#create(storage,fqn)
4) XtendResourceParser#parse() retrieves the wrong (!) project through IResource#getProject. It points to the External Folders project!
5) The PluginExtensionFactory is instantiated with this non-Java project. This fails subsequently to retrieve Java types from it. The PluginExtensionFactory must be instantiated with the IJavaProject from which the request originates.
The ResourceContributor interface does not allow to pass the project to the parser. This is required as additional argument to the create() method. Therefore an interface extension ResourceContributor2 is required.
Forgot to close it. Fixed with 979f50390e5c8308b974c71bae5c2176c32967f9 on 2012-11-26. Requested via bug 522520. -M. Requested via bug 522520. -M. |