final ArrayList list = new ArrayList();
final State state = TargetPlatformHelper.getState();
final IProductPlugin[] plugins = prod.getPlugins();
for (int i = 0; i < plugins.length; i++)
{
final BundleDescription bundle = state.getBundle(plugins[i].getId(), null);
if (bundle != null)
list.add(bundle);
}
// implicitly add the new launcher plug-in/fragment if we are to use the
// new launching story and the launcher plug-in/fragment are not already included in the .product file
final IPluginModelBase launcherPlugin = PluginRegistry.findModel("org.eclipse.equinox.launcher"); //$NON-NLS-1$
if (launcherPlugin != null)
{
final BundleDescription bundle = launcherPlugin.getBundleDescription();
if (bundle != null && !list.contains(bundle))
{
list.add(bundle);
final BundleDescription[] fragments = bundle.getFragments();
for (int i = 0; i < fragments.length; i++)
{
if (!list.contains(fragments[i]))
{
list.add(fragments[i]);