Bug 101104 - "Attempted to beginRule errors" during jdt.core model tests
Summary: "Attempted to beginRule errors" during jdt.core model tests
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Gary Horen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 14:25 EDT by Mike Kaufman CLA
Modified: 2005-08-02 17:14 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaufman CLA 2005-06-21 14:25:49 EDT
To repro.  

1.  open a workspace with the APT plugin as a project
2. right-click org.eclipse.jdt.core.tests.RunModelTests in the package explorer
3.  select Run-as Junit plugin test.  (make sure you are running under a 1.5 
VM)

You will see the following exception.  We need to figure out what is going on


java.lang.IllegalArgumentException: Attempted to beginRule: R/, does not match 
outer scope rule: L/JavaSearch/src/wc/X.java
	at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:58)
	at org.eclipse.core.internal.jobs.ThreadJob.illegalPush
(ThreadJob.java:117)
	at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:211)
	at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:59)
	at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:190)
	at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:96)
	at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1674)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1714)
	at org.eclipse.jdt.apt.core.internal.APTDispatch.runAPT
(APTDispatch.java:70)
	at org.eclipse.jdt.apt.core.internal.APTDispatch.runAPTDuringReconcile
(APTDispatch.java:53)
	at 
org.eclipse.jdt.apt.core.internal.AptCompilationParticipant.postReconcileNotify
(AptCompilationParticipant.java:158)
	at org.eclipse.jdt.apt.core.internal.AptCompilationParticipant.notify
(AptCompilationParticipant.java:76)
	at 
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.notifyCompilationPa
rticipants(ReconcileWorkingCopyOperation.java:143)
	at 
org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation
(ReconcileWorkingCopyOperation.java:57)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:718)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation
(JavaModelOperation.java:777)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile
(CompilationUnit.java:1081)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile
(CompilationUnit.java:1038)
	at org.eclipse.jdt.internal.core.CompilationUnit.save
(CompilationUnit.java:1120)
	at 
org.eclipse.jdt.internal.core.CreateElementInCUOperation.executeOperation
(CreateElementInCUOperation.java:140)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:718)
	at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1719)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation
(JavaModelOperation.java:782)
	at org.eclipse.jdt.internal.core.CompilationUnit.createType
(CompilationUnit.java:401)
	at 
org.eclipse.jdt.core.tests.model.WorkingCopySearchTests.testAddNewType
(WorkingCopySearchTests.java:89)
	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 junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.runTest
(SuiteOfTestCases.java:99)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.superRun
(SuiteOfTestCases.java:83)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$1.protect
(SuiteOfTestCases.java:71)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.run
(SuiteOfTestCases.java:80)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:476)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:342)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main
(RemotePluginTestRunner.java:57)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run
(UITestApplication.java:99)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:118)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2910)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2569)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1717)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1681)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:366)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:103)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.run
(UITestApplication.java:39)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:375)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:162)
	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.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Mike Kaufman CLA 2005-06-22 17:12:03 EDT
I think that the fix here may be updating 
ReconcileWorkingCopyOperation.isReadOnly() to return false.  This should 
schedule the operation with the workspace as the scehduleing rule.  

Need to verify this will work & need to run it by the JDT team. 
Comment 2 Mike Kaufman CLA 2005-08-02 17:14:03 EDT
Should now be fixed since reconcile type-generation only works on in-memory 
copies, and doesn't touch disk, doesn't take any locks, and doesn't schedule 
itself with an ISchedulingRule.