Bug 311004 - ManagedBuildManager #getBuildInfo #saveBuildInfo should be deprecated
Summary: ManagedBuildManager #getBuildInfo #saveBuildInfo should be deprecated
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 7.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 07:52 EDT by James Blackburn CLA
Modified: 2020-09-04 15:26 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 James Blackburn CLA 2010-04-29 07:52:46 EDT
ManagedBuildManager has a static Map of IProject -> IManagedBuildInfo.  This contains all the build state including IConfigurations for all open projects in the workspace. This, with the associated API, presents a number of problems:

  - No thread-safety / mutual exclusion.  All clients of this API get the _same_ MBInfo with no way to safely edit the build configuration.
  - Synchronization with the project model is very complicated. There are enough call-backs / hooks  (+ bugs) to confuse anyone.
  - Memory usage is unbounded. The cache never lets go of any of the build information, nor can it if users use this API - this is true even if users never build the project.
  - Editing the build info via the core model is the recommended way of doing this - and the way the MBS UI does it.

Instead of editing the shared IConfiguration directly, plugins should do:

ICProjectDescription desc = CoreModel.getDefault().getProjectDescription(IProject);
ICConfigurationDescription cfgDesc = desc.getConfigurationById(id);
ManagedBuildManager.getConfigurationForDescription(cfgDesc);
...
<do some stuff with the IConfiguration>
...
CoreModel.getDefault().setProjectDescription(IProject, desc);