| Summary: | Project-level preferences are being applied to all projects in a workspace | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Alex Ruiz <alruiz> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | SR1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Build Identifier: I20110526-1708 When changing preferences for a particular project, the changes get saved to all the projects in the workspace. After some debugging, I think the problem is in PreferenceStoreAccessImpl, in the method getWritablePreferenceStore(Object), line 59: Code: [Select all] [Show/ hide] public IPreferenceStore getWritablePreferenceStore(Object context) { lazyInitialize(); if (context instanceof IFileEditorInput) { context = ((IFileEditorInput) context).getFile().getProject(); } if (context instanceof IProject) { ProjectScope projectScope = new ProjectScope((IProject) context); ScopedPreferenceStore result = new ScopedPreferenceStore(projectScope, getQualifier()); result.setSearchContexts(new IScopeContext[] { projectScope, new InstanceScope(), new ConfigurationScope() }); } return getWritablePreferenceStore(); } when the context is a IProject, this method creates a ScopedPreferenceStore using the passed IProject as one of the scopes. I think the problem is, the created ScopedPreferenceStore is never returned, instead, this method always returns the one from getWritablePreferenceStore(). Reproducible: Always Steps to Reproduce: This is my use case. I have a Xtext-based editor that has preference pages at the project level. Every time I save preferences for one project, the rest of projects in the same workspace get such preferences as well. Reference: http://www.eclipse.org/forums/index.php/m/677591/#msg_677591