Community
Participate
Eclipse IDE
I tried to change the encoding on a file and got the following exception. Afterwards the Properties dialog for the file continued to indicate that the file encoding had been changed. But when I restarted Eclipse it was reset to the previous value (the default). !ENTRY org.eclipse.core.runtime 4 2 2005-06-29 21:55:01.621 !MESSAGE An internal error occurred during: "Setting encoding". !STACK 0 java.lang.IllegalArgumentException: Attempted to beginRule: R/, does not match outer scope rule: P/<project name> 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.Folder.create(Folder.java:88) at org.eclipse.core.internal.resources.ProjectPreferences$2.run(ProjectPreferences.java:304) at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:315) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:351) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:585) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:339) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:585) at org.eclipse.core.internal.resources.CharsetManager.setCharsetFor(CharsetManager.java:280) at org.eclipse.core.internal.resources.File.setCharset(File.java:448) at org.eclipse.ui.ide.dialogs.ResourceEncodingFieldEditor$1.run(ResourceEncodingFieldEditor.java:136) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Which build are you using?
Jed, was the project in question associated with any kind of repository (CVS or otherwise)?
Also, can you reproduce it consistently?
This is a 3.1 Release build bug. The project was connected to a Perforce server via the P4WSAD plugin which can be found at http://www.perforce.com/perforce/products/p4wsad.html I tried creating a simple project, adding a file to it, and then changing the encoding. That worked. Then I associated the project with the P4WSAD repo provider and tried to change the settings and it failed. Cool. If you want to try it, the bug reproduces even if you don't have a Perforce repository. Just install the provider and dummy up some values for the connection settings. The update site for the provider is: http://www.perforce.com/downloads/http/p4-wsad/install/ I used the following for the values for the connection settings: Port: codenovo.com:1666 User: jkca Client Workspace: jkca
When setting the charset for a project, we might end up using use two nested rules: outer: charsetRule(project) inner: createRule(.settings directory) The PessimisticResourceRuleFactory is in charge in this case, but does not override charsetRule(). Thus, the charsetRule() (inherited from ResourceRuleFactory) will return the project, but then later the createRule() will return the workspace root, causing the problem above. So, the fix would be to make sure PessimisticResourceRuleFactory overrides charsetRule() as well. Moving to Platform/Team.
Too bad this just came up now. It had been like that for a long time (see bug 75750).
Fix released to both 3.1.1 and 3.2.
Verified fixed in M20050923-1430
*** Bug 116256 has been marked as a duplicate of this bug. ***