Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 299099

Summary: Exception in ProjectAnalyzer on project creation
Product: [Modeling] M2T Reporter: Sven Efftinge <sven.efftinge>
Component: XpandAssignee: Darius Jockel <darius.jockel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: darius.jockel, m2t.xpand-inbox, sebastian.zarnekow
Version: 0.8.0Flags: sven.efftinge: helios+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 284019    
Attachments:
Description Flags
Patch
none
Patch for the ResourceException none

Description Sven Efftinge CLA 2010-01-08 03:21:37 EST
When using the wizard from bug #284019, I get the following exception when using creating a "workspace defaults" project:

java.lang.IllegalArgumentException: Attempted to beginRule: P/.org.eclipse.jdt.core.external.folders, does not match outer scope rule: P/my.generator.project_ws_defaults
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:120)
at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:230)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:80)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:232)
at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117)
at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1747)
at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1514)
at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.loadMetamodelsForProject(ProjectAnalyzer.java:127)
at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.run(ProjectAnalyzer.java:90)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Darius Jockel CLA 2010-01-29 03:25:57 EST
Hello Sven.

(In reply to comment #0)
> When using the wizard from bug #284019, I get the following exception when
> using creating a "workspace defaults" 

Sorry, but I can not reproduce the problem.
Can you please provide more information?

I tried two times to generate a example project with default settings,
but without getting an exception.

Regards
Comment 2 Sebastian Zarnekow CLA 2010-01-29 03:33:52 EST
I've seen this one, too after I upgraded my dev environment to 3.6
Comment 3 Darius Jockel CLA 2010-01-29 05:01:58 EST
(In reply to comment #2)
> I've seen this one, too after I upgraded my dev environment to 3.6

Ok. I run Eclipse 3.5.1
I will update my environment, too.
Comment 4 Darius Jockel CLA 2010-02-02 09:19:20 EST
Created attachment 157905 [details]
Patch

If an project is deleted from workspace but the contents are not deleted too,
the project wizard will throw an exception:
org.eclipse.core.internal.resources.ResourceException: Resource '/my.generator.project/META-INF' already exists.
Comment 5 Darius Jockel CLA 2010-02-02 09:22:38 EST
(In reply to comment #2)
> I've seen this one, too after I upgraded my dev environment to 3.6

I have updated my environment, too (Also I used the xtext projectset).
But I can still not reproduce the error.

All I got is a: org.eclipse.core.internal.resources.ResourceException
(see last comment).
Comment 6 Darius Jockel CLA 2010-02-15 05:37:02 EST
(In reply to comment #0)
This bug can only be caused by Runtime Eclipse Instances.
If you delete a lot of projects and then you create a new project,
the ProjectAnalyser will scan recursively all projects for metamodells.
After the "bulk delete" the plugin projects from the "motherworkspace" (is it the right word?) return false on .exists() and force a refresh on this projects.
This cause a ResourceException. 

Running a Eclipse with Xpand M5 installed do not cause this Exception.

Therefore I would like to close this Bug.
Comment 7 Sven Efftinge CLA 2010-02-15 05:47:03 EST
I thought I'd fixed that only last week. Is it really not happening in M5 or is it not happening with the current HEAD?
Comment 8 Darius Jockel CLA 2010-02-15 07:56:22 EST
(In reply to comment #7)
> I thought I'd fixed that only last week. Is it really not happening in M5 or is
> it not happening with the current HEAD?

In HEAD I got the following exception:
org.eclipse.core.internal.resources.ResourceException: Resource '/.org.eclipse.jdt.core.external.folders/.link6' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:319)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:196)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:49)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:106)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:90)
	at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.loadMetamodelsForProject(ProjectAnalyzer.java:128)
	at org.eclipse.xtend.typesystem.emf.ui.ProjectAnalyzer.run(ProjectAnalyzer.java:90)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

But only in a Runtime Eclipse
Comment 9 Sven Efftinge CLA 2010-02-15 07:58:32 EST
(In reply to comment #8)
> In HEAD I got the following exception:
> org.eclipse.core.internal.resources.ResourceException: Resource
> '/.org.eclipse.jdt.core.external.folders/.link6' does not exist.
> 
> But only in a Runtime Eclipse


That's another one which we have to fix.

The one I fixed is : java.lang.IllegalArgumentException: Attempted to beginRule:
P/.org.eclipse.jdt.core.external.folders, does not match outer scope rule:
P/my.generator.project_ws_defaults
Comment 10 Sven Efftinge CLA 2010-02-15 08:06:35 EST
*** Bug 298641 has been marked as a duplicate of this bug. ***
Comment 11 Darius Jockel CLA 2010-02-17 11:34:42 EST
Created attachment 159331 [details]
Patch for the ResourceException

Patch fixed the ResourceException (see comment 8)
Comment 12 Darius Jockel CLA 2010-02-18 09:42:38 EST
(In reply to comment #7)
> I thought I'd fixed that only last week. 
Yes, it is fixed.
Comment 13 Karsten Thoms CLA 2013-02-21 08:13:33 EST
Bug resolved before Xpand 1.2 release date => Closing