diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java index 8af476ddd5..538e97f1f6 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java @@ -111,7 +111,8 @@ public static Map getAllSelectedPluginBundles(ILaunchC private static void addRequiredBundles(Map bundle2startLevel, ILaunchConfiguration configuration) throws CoreException { - RequirementHelper.addApplicationLaunchRequirements(bundle2startLevel, configuration); + List appRequirements = RequirementHelper.getApplicationLaunchRequirements(configuration); + RequirementHelper.addApplicationLaunchRequirements(appRequirements, configuration, bundle2startLevel); boolean includeOptional = configuration.getAttribute(IPDELauncherConstants.INCLUDE_OPTIONAL, true); Set requiredDependencies = includeOptional // @@ -167,7 +168,8 @@ private static Map getMergedBundleMapFeatureBased(ILau if (addRequirements) { // Add all missing plug-ins required by the application/product set in the config - RequirementHelper.addApplicationLaunchRequirements(configuration, launchPlugins, launchPlugins::add); + List appRequirements = RequirementHelper.getApplicationLaunchRequirements(configuration); + RequirementHelper.addApplicationLaunchRequirements(appRequirements, configuration, launchPlugins, launchPlugins::add); // Get all required plugins Set additionalBundles = DependencyManager.getDependencies(launchPlugins); diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/RequirementHelper.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/RequirementHelper.java index 64c4ba227b..8e23ff05af 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/RequirementHelper.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/RequirementHelper.java @@ -78,16 +78,15 @@ public static List getApplicationLaunchRequirements(ILaunchConfiguration return requirementsFunction != null ? Objects.requireNonNull(requirementsFunction.getRequiredBundleIds(config)) : Collections.emptyList(); } - public static boolean addApplicationLaunchRequirements(Map bundle2startLevel, ILaunchConfiguration configuration) throws CoreException { + public static boolean addApplicationLaunchRequirements(List appRequirements, ILaunchConfiguration configuration, Map bundle2startLevel) throws CoreException { Consumer addPlugin = b -> BundleLauncherHelper.addDefaultStartingBundle(bundle2startLevel, b); - return addApplicationLaunchRequirements(configuration, bundle2startLevel.keySet(), addPlugin); + return addApplicationLaunchRequirements(appRequirements, configuration, bundle2startLevel.keySet(), addPlugin); } - public static boolean addApplicationLaunchRequirements(ILaunchConfiguration configuration, Set containedPlugins, Consumer addPlugin) throws CoreException { + public static boolean addApplicationLaunchRequirements(List appRequirements, ILaunchConfiguration configuration, Set containedPlugins, Consumer addPlugin) throws CoreException { boolean isFeatureBasedLaunch = configuration.getAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false); String pluginResolution = isFeatureBasedLaunch ? configuration.getAttribute(IPDELauncherConstants.FEATURE_PLUGIN_RESOLUTION, IPDELauncherConstants.LOCATION_WORKSPACE) : IPDELauncherConstants.LOCATION_WORKSPACE; - List appRequirements = getApplicationLaunchRequirements(configuration); boolean allRequirementsSatisfied = true; for (String requiredBundleId : appRequirements) { ModelEntry entry = PluginRegistry.findEntry(requiredBundleId); diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EquinoxLaunchConfiguration.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EquinoxLaunchConfiguration.java index 3bc8b19767..cc86886ee4 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EquinoxLaunchConfiguration.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EquinoxLaunchConfiguration.java @@ -164,7 +164,7 @@ private void appendStartData(StringBuilder buffer, String startData, boolean def protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { fModels = BundleLauncherHelper.getMergedBundleMap(configuration, true); - if (!RequirementHelper.addApplicationLaunchRequirements(fModels, configuration)) { + if (!RequirementHelper.addApplicationLaunchRequirements(List.of(IPDEBuildConstants.BUNDLE_OSGI), configuration, fModels)) { throw new CoreException(Status.error(PDEMessages.EquinoxLaunchConfiguration_oldTarget)); } fAllBundles = fModels.keySet().stream().collect(Collectors.groupingBy(m -> m.getPluginBase().getId(), HashMap::new, Collectors.toCollection(ArrayList::new))); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java index b896e330ae..edc236e67b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxLaunchConfiguration.java @@ -30,7 +30,6 @@ import org.eclipse.pde.internal.launching.IPDEConstants; import org.eclipse.pde.internal.launching.PDEMessages; import org.eclipse.pde.internal.launching.launcher.*; -import org.eclipse.pde.launching.IPDELauncherConstants; /** * A launch delegate for launching the Equinox framework @@ -162,7 +161,7 @@ private void appendStartData(StringBuilder buffer, String startData, boolean def protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { fModels = BundleLauncherHelper.getMergedBundleMap(configuration, true); - if (!RequirementHelper.addApplicationLaunchRequirements(fModels, configuration)) { + if (!RequirementHelper.addApplicationLaunchRequirements(List.of(IPDEBuildConstants.BUNDLE_OSGI), configuration, fModels)) { throw new CoreException(Status.error(PDEMessages.EquinoxLaunchConfiguration_oldTarget)); } fAllBundles = fModels.keySet().stream().collect(Collectors.groupingBy(m -> m.getPluginBase().getId(),