Community
Participate
Working Groups
This is a near verbatim replica of bug 95288. Changes are highlighted. "I have an operation that creates *several JPA entities within a given project*. I run this operation using the *project* as the scheduling rule. The problem is that I have to call *PackageFragment#createCompilationUnit(...)* which runs the Create*CompilationUnit*Operation under a scheduling rule of WorkspaceRoot. This causes an IllegalArgumentException to be thrown. This means I have to change my operation to run with the WorkspaceRoot as the scheduling rule. I see no reason why the creation of a *CompilationUnit* would need a scheduling rule broader than the *PackageFragment* under which it is being created." In addition, I might suggest that similar operations also be examined.
I'm not sure why you're seeing an IWorkspaceSchedulingRule. The code is using IResourceRuleFactory.createRule(...) which returns an IFolder corresponding to the package. This was fixed by bug 50320. Added CreateCompilationUnitTests.testSchedulingRule().
Verified for 3.5M2 using I20080914-2000