Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341214 - AbstractProjectWorkspacePreference should enable project to be taken into account when calculating preference value based on workspace preference
Summary: AbstractProjectWorkspacePreference should enable project to be taken into acc...
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.7.0   Edit
Assignee: Stephan Eberle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340301
  Show dependency tree
 
Reported: 2011-03-29 07:43 EDT by Stephan Eberle CLA
Modified: 2021-07-14 02:16 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 Stephan Eberle CLA 2011-03-29 07:43:16 EDT
= Problem description =
When AbstractProjectWorkspacePreference is used on a project that has on project-specific settings the workspace level preference value is returned (see AbstractProjectWorkspacePreference#get(IProject) for details). The conversion of the preference's string value to the corresponding object value is delegated to AbstractProjectWorkspacePreference#toObject(IProject, String) so as to enable clients to customize it. However, when this is called for converting the workspace level preference value, the IProject argument is always null and clients cannot rely on it for calculating the preference's object value in a project dependent way.

= Resolution proposal =
* Introduce a new method getFromWorkspaceForProject(IProject) on IProjectWorkspacePreference
* Implement it in the same way as AbstractWorkspacePreference#get() but delegate to AbstractProjectWorkspacePreference#toObject(IProject, String) instead of AbstractProjectWorkspacePreference#toObject(String)
* Delegate to that method when retrieving the workspace level preference value in AbstractProjectWorkspacePreference#get(IProject)
* Additionally, delegate to #getFromProject(IProject) when retrieving the project level preference value in AbstractProjectWorkspacePreference#get(IProject)
Comment 1 Stephan Eberle CLA 2011-03-29 08:00:42 EDT
Fixed as proposed in description.
Comment 2 Balazs Grill CLA 2021-07-14 02:16:37 EDT
Mass-closing Resolved tickets