Bug 308623 - IPluginModelBase.getBuildModel() always returns null
Summary: IPluginModelBase.getBuildModel() always returns null
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-04-09 06:42 EDT by Nicolas Bros CLA
Modified: 2010-09-13 11:26 EDT (History)
5 users (show)

See Also:


Attachments
Patch (720 bytes, patch)
2010-08-09 03:54 EDT, Ankur Sharma CLA
no flags Details | Diff
patch (6.90 KB, patch)
2010-08-09 14:53 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2010-04-09 06:42:13 EDT
I am using the following code:
IPluginModelBase pluginModel = PluginRegistry.findModel(project);
IBuildModel buildModel = pluginModel.getBuildModel();

buildModel is always null here. This is the only API I found to get IBuildModel.
Am I missing something?
Comment 1 Nicolas Bros CLA 2010-04-09 07:18:46 EDT
setBuildModel does not seem to be called from anywhere.
This is also confirmed by bug 206051 (Unreferenced members report for org.eclipse.pde.core).
Comment 2 Curtis Windatt CLA 2010-04-14 12:19:48 EDT
The method should have never been API.  We do not keep an up to date build model, instead we create WorkspaceBuildModels internally when needed.  There are no plans to change this behaviour.  In 3.7 we should mark the method deprecated.
Comment 3 Ankur Sharma CLA 2010-08-09 03:54:13 EDT
Created attachment 176128 [details]
Patch

The method is being used at

org.eclipse.pde.internal.core - src - org.eclipse.pde.core
	ClasspathUtilCore
		getBuild(IPluginModelBase)
org.eclipse.pde.internal.ui.wizards.imports - src - org.eclipse.pde.ui
	PluginImportWizardExpressPage
		addExtraPrerequisites(IPluginModelBase, ArrayList)
Comment 4 Darin Wright CLA 2010-08-09 14:53:51 EDT
Created attachment 176177 [details]
patch

This patch adds API to PluginRegistry to create a new build model for a bundle (IPluginModelBase) in addition to deprecating the #getBuildModel() method. This avoids having to keep the build model and plug-in model in synch - clients may just create a build model on demand and manage it themselves.
Comment 5 Darin Wright CLA 2010-08-13 12:11:21 EDT
Released. Fixed.