Skip to content

Commit 00ec25c

Browse files
committed
Reduce re-computation of plugins included in Eclipse/OSGi launches
This ensures consistency and reduces calls of DependencyManager.findRequirementsClosure().
1 parent e63f3f9 commit 00ec25c

File tree

11 files changed

+68
-56
lines changed

11 files changed

+68
-56
lines changed

ui/org.eclipse.pde.launching/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %name
44
Bundle-SymbolicName: org.eclipse.pde.launching;singleton:=true
5-
Bundle-Version: 3.13.400.qualifier
5+
Bundle-Version: 3.14.0.qualifier
66
Bundle-RequiredExecutionEnvironment: JavaSE-17
77
Bundle-Vendor: %provider-name
88
Require-Bundle: org.eclipse.jdt.junit.core;bundle-version="[3.6.0,4.0.0)",

ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchArgumentsHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ public static File getWorkingDirectory(ILaunchConfiguration configuration) throw
207207
return dir;
208208
}
209209

210-
public static Map<String, Object> getVMSpecificAttributesMap(ILaunchConfiguration config) throws CoreException {
210+
public static Map<String, Object> getVMSpecificAttributesMap(ILaunchConfiguration config, Set<IPluginModelBase> plugins) throws CoreException {
211211
Map<String, Object> map = new HashMap<>(2);
212212
String javaCommand = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND, (String) null);
213213
map.put(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND, javaCommand);
214214
// Add jdi.jar for macos when java version is less than 1.7
215215
if (TargetPlatform.getOS().equals("macosx")) { //$NON-NLS-1$
216216
ModelEntry entry = PluginRegistry.findEntry("org.eclipse.jdt.debug"); //$NON-NLS-1$
217217
if (entry != null) {
218-
IVMInstall vmInstall = VMHelper.getVMInstall(config);
218+
IVMInstall vmInstall = VMHelper.getVMInstall(config, plugins);
219219
if (vmInstall instanceof AbstractVMInstall) {
220220
String javaVersion = ((AbstractVMInstall) vmInstall).getJavaVersion();
221221
String[] javaVersionSegments = javaVersion.split("\\."); //$NON-NLS-1$

ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchValidationOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected Dictionary<String, String>[] getPlatformProperties() throws CoreExcept
8484
}
8585

8686
protected IExecutionEnvironment[] getMatchingEnvironments() throws CoreException {
87-
IVMInstall install = VMHelper.getVMInstall(fLaunchConfiguration);
87+
IVMInstall install = VMHelper.getVMInstall(fLaunchConfiguration, fModels);
8888
return install == null ? new IExecutionEnvironment[0] : getMatchingEEs(install);
8989
}
9090

ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/VMHelper.java

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.eclipse.pde.core.plugin.IPluginModelBase;
3737
import org.eclipse.pde.internal.core.util.VMUtil;
3838
import org.eclipse.pde.internal.launching.PDEMessages;
39-
import org.eclipse.pde.launching.EquinoxLaunchConfiguration;
4039

4140
public class VMHelper {
4241

@@ -49,24 +48,22 @@ public class VMHelper {
4948
* @return string id of a valid execution environment with a bound JRE or <code>null</code>
5049
* @throws CoreException if there is a problem reading the bundles from the launch configuration
5150
*/
52-
public static String getDefaultEEName(ILaunchConfiguration configuration) throws CoreException {
51+
public static String getDefaultEEName(Set<IPluginModelBase> plugins) throws CoreException {
5352
// List of all valid EEs, removed if they don't match
5453
List<IExecutionEnvironment> validEEs = new LinkedList<>(); // Use a list to keep order
5554
validEEs.addAll(Arrays.asList(JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments()));
5655

5756
// Find EEs that do not have a compatible JRE (are unbound)
5857
Set<String> unboundEEs = new HashSet<>();
59-
for (Iterator<IExecutionEnvironment> iterator = validEEs.iterator(); iterator.hasNext();) {
60-
IExecutionEnvironment current = iterator.next();
61-
if (current.getCompatibleVMs().length == 0) {
62-
iterator.remove();
63-
unboundEEs.add(current.getId());
58+
validEEs.removeIf(ee -> {
59+
if (ee.getCompatibleVMs().length == 0) {
60+
unboundEEs.add(ee.getId());
61+
return true;
6462
}
65-
}
63+
return false;
64+
});
6665

6766
// Iterate through all launch models
68-
boolean isOSGiLaunch = configuration instanceof EquinoxLaunchConfiguration; // TODO Test this
69-
Set<IPluginModelBase> plugins = BundleLauncherHelper.getMergedBundleMap(configuration, isOSGiLaunch).keySet();
7067
for (IPluginModelBase plugin : plugins) {
7168
if (validEEs.isEmpty()) {
7269
break; // No valid EEs left, short circuit
@@ -82,13 +79,7 @@ public static String getDefaultEEName(ILaunchConfiguration configuration) throws
8279
if (bundleEnvs.length > 0) {
8380

8481
// See if the BREE matches an unbound EE, if so skip this plug-in as we cannot launch it
85-
boolean isUnbound = false;
86-
for (String bundleEnv : bundleEnvs) {
87-
if (unboundEEs.contains(bundleEnv)) {
88-
isUnbound = true;
89-
break;
90-
}
91-
}
82+
boolean isUnbound = Arrays.stream(bundleEnvs).anyMatch(unboundEEs::contains);
9283
if (isUnbound) {
9384
continue; // Use another bundle to determine best EE
9485
}
@@ -161,10 +152,11 @@ public static String getDefaultVMInstallName(ILaunchConfiguration configuration)
161152
* a default setting will be used (but not saved in the launch configuration).
162153
*
163154
* @param configuration the configuration to get a vm install for
155+
* @param plugins all plugins included in the launch
164156
* @return a vm install from {@link JavaRuntime}
165157
* @throws CoreException if a vm install could not be found for the settings in the configuration
166158
*/
167-
public static IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException {
159+
public static IVMInstall getVMInstall(ILaunchConfiguration configuration, Set<IPluginModelBase> plugins) throws CoreException {
168160
String jre = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null);
169161

170162
// Launch configuration has a JRE or EE set, throw exception if associated vm not found
@@ -183,7 +175,7 @@ public static IVMInstall getVMInstall(ILaunchConfiguration configuration) throws
183175
}
184176

185177
// Find a default EE
186-
String eeId = VMHelper.getDefaultEEName(configuration);
178+
String eeId = VMHelper.getDefaultEEName(plugins);
187179
if (eeId != null) {
188180
IExecutionEnvironment ee = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(eeId);
189181
String vmName = VMUtil.getVMInstallName(ee);
@@ -207,8 +199,8 @@ public static IVMInstall getVMInstall(ILaunchConfiguration configuration) throws
207199

208200
}
209201

210-
public static IVMInstall createLauncher(ILaunchConfiguration configuration) throws CoreException {
211-
IVMInstall launcher = getVMInstall(configuration);
202+
public static IVMInstall createLauncher(ILaunchConfiguration configuration, Set<IPluginModelBase> plugins) throws CoreException {
203+
IVMInstall launcher = getVMInstall(configuration, plugins);
212204
if (!launcher.getInstallLocation().exists()) {
213205
throw new CoreException(Status.error(PDEMessages.WorkbenchLauncherConfigurationDelegate_jrePathNotFound));
214206
}
@@ -226,7 +218,8 @@ public static IVMInstall createLauncher(ILaunchConfiguration configuration) thro
226218
* or if unable to retrieve the launch configuration attributes
227219
*/
228220
public static IRuntimeClasspathEntry getJREEntry(ILaunchConfiguration configuration) throws CoreException {
229-
IVMInstall jre = createLauncher(configuration);
221+
Set<IPluginModelBase> plugins = BundleLauncherHelper.getMergedBundleMap(configuration, false).keySet();
222+
IVMInstall jre = createLauncher(configuration, plugins);
230223
IPath containerPath = IPath.fromOSString(JavaRuntime.JRE_CONTAINER);
231224
containerPath = containerPath.append(jre.getVMInstallType().getId());
232225
containerPath = containerPath.append(jre.getName());

ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/AbstractPDELaunchConfiguration.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public abstract class AbstractPDELaunchConfiguration extends LaunchConfiguration
7878

7979
protected File fConfigDir = null;
8080
String launchMode;
81+
private Set<IPluginModelBase> launchedPlugins;
8182

8283
/**
8384
* This field will control the addition of argument --add-modules=ALL-SYSTEM in the VM arguments
@@ -101,8 +102,9 @@ public String showCommandLine(ILaunchConfiguration configuration, String mode, I
101102
String commandLine = ""; //$NON-NLS-1$
102103
launch.setAttribute(PDE_LAUNCH_SHOW_COMMAND, "true"); //$NON-NLS-1$
103104
fConfigDir = null;
104-
SubMonitor subMonitor = SubMonitor.convert(monitor, 4);
105+
SubMonitor subMonitor = SubMonitor.convert(monitor, 5);
105106
try {
107+
launchedPlugins = computeLaunchedPlugins(configuration, subMonitor.split(1));
106108
preLaunchCheck(configuration, launch, subMonitor.split(2));
107109
} catch (CoreException e) {
108110
if (e.getStatus().getSeverity() == IStatus.CANCEL) {
@@ -113,7 +115,7 @@ public String showCommandLine(ILaunchConfiguration configuration, String mode, I
113115
}
114116

115117
VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration));
116-
IVMInstall launcher = VMHelper.createLauncher(configuration);
118+
IVMInstall launcher = VMHelper.createLauncher(configuration, launchedPlugins);
117119
runnerConfig.setVMArguments(updateVMArgumentWithAdditionalArguments(getVMArguments(configuration), launcher));
118120
runnerConfig.setProgramArguments(getProgramArguments(configuration));
119121
runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath());
@@ -126,7 +128,7 @@ public String showCommandLine(ILaunchConfiguration configuration, String mode, I
126128
manageLaunch(launch);
127129
IVMRunner runner = getVMRunner(configuration, mode);
128130
if (runner != null) {
129-
commandLine = runner.showCommandLine(runnerConfig, launch, subMonitor);
131+
commandLine = runner.showCommandLine(runnerConfig, launch, subMonitor.split(1));
130132
} else {
131133
subMonitor.setCanceled(true);
132134
}
@@ -139,7 +141,8 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
139141
fConfigDir = null;
140142
SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
141143
try {
142-
preLaunchCheck(configuration, launch, subMonitor.split(50));
144+
launchedPlugins = computeLaunchedPlugins(configuration, subMonitor.split(10));
145+
preLaunchCheck(configuration, launch, subMonitor.split(40));
143146
} catch (CoreException e) {
144147
if (e.getStatus().getSeverity() == IStatus.CANCEL) {
145148
subMonitor.setCanceled(true);
@@ -149,7 +152,7 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
149152
}
150153

151154
VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration));
152-
IVMInstall launcher = VMHelper.createLauncher(configuration);
155+
IVMInstall launcher = VMHelper.createLauncher(configuration, launchedPlugins);
153156
runnerConfig.setVMArguments(updateVMArgumentWithAdditionalArguments(getVMArguments(configuration), launcher));
154157
runnerConfig.setProgramArguments(getProgramArguments(configuration));
155158
runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath());
@@ -166,7 +169,11 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun
166169
} else {
167170
subMonitor.setCanceled(true);
168171
}
172+
}
169173

174+
Set<IPluginModelBase> computeLaunchedPlugins(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
175+
//Sub-classes should overwrite this method and pass the set of to be launched plug-ins they probably have already computed
176+
return BundleLauncherHelper.getMergedBundleMap(configuration, false).keySet();
170177
}
171178

172179
private String[] updateVMArgumentWithAdditionalArguments(String[] args, IVMInstall vmInstall) {
@@ -216,7 +223,7 @@ private boolean isEclipseBundleGreaterThanVersion(int major, int minor) {
216223
* @throws CoreException if a VM runner cannot be determined
217224
*/
218225
public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode) throws CoreException {
219-
IVMInstall launcher = VMHelper.createLauncher(configuration);
226+
IVMInstall launcher = VMHelper.createLauncher(configuration, launchedPlugins);
220227
return launcher.getVMRunner(mode);
221228
}
222229

@@ -303,7 +310,7 @@ public File getWorkingDirectory(ILaunchConfiguration configuration) throws CoreE
303310
* if unable to retrieve the attribute
304311
*/
305312
public Map<String, Object> getVMSpecificAttributesMap(ILaunchConfiguration configuration) throws CoreException {
306-
return LaunchArgumentsHelper.getVMSpecificAttributesMap(configuration);
313+
return LaunchArgumentsHelper.getVMSpecificAttributesMap(configuration, launchedPlugins);
307314
}
308315

309316
/**

ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EclipseApplicationLaunchConfiguration.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.List;
2323
import java.util.Map;
2424
import java.util.Properties;
25+
import java.util.Set;
2526
import java.util.stream.Collectors;
2627
import java.util.stream.Stream;
2728

@@ -206,16 +207,20 @@ protected void clear(ILaunchConfiguration configuration, IProgressMonitor monito
206207
}
207208

208209
@Override
209-
protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException {
210-
fWorkspaceLocation = null;
210+
Set<IPluginModelBase> computeLaunchedPlugins(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
211211
if (configuration.getAttribute(IPDELauncherConstants.GENERATE_PROFILE, false)) {
212212
fFeatures = new HashMap<>();
213213
} else {
214214
fFeatures = null;
215215
}
216216
fModels = BundleLauncherHelper.getMergedBundleMap(configuration, false, fFeatures);
217217
fAllBundles = fModels.keySet().stream().collect(Collectors.groupingBy(m -> m.getPluginBase().getId()));
218+
return fModels.keySet();
219+
}
218220

221+
@Override
222+
protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException {
223+
fWorkspaceLocation = null;
219224
validateConfigIni(configuration);
220225
super.preLaunchCheck(configuration, launch, monitor);
221226
}

ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/EquinoxLaunchConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
import java.util.Map;
2424
import java.util.Map.Entry;
2525
import java.util.Properties;
26+
import java.util.Set;
2627
import java.util.stream.Collectors;
2728

2829
import org.eclipse.core.runtime.CoreException;
2930
import org.eclipse.core.runtime.IPath;
3031
import org.eclipse.core.runtime.IProgressMonitor;
3132
import org.eclipse.core.runtime.Status;
32-
import org.eclipse.debug.core.ILaunch;
3333
import org.eclipse.debug.core.ILaunchConfiguration;
3434
import org.eclipse.pde.core.plugin.IFragmentModel;
3535
import org.eclipse.pde.core.plugin.IPluginModelBase;
@@ -185,15 +185,14 @@ private void appendStartData(StringBuilder buffer, String startData, boolean def
185185
}
186186

187187
@Override
188-
protected void preLaunchCheck(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException {
188+
Set<IPluginModelBase> computeLaunchedPlugins(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
189189
fModels = BundleLauncherHelper.getMergedBundleMap(configuration, true);
190190

191191
if (!RequirementHelper.addApplicationLaunchRequirements(List.of(IPDEBuildConstants.BUNDLE_OSGI), configuration, fModels)) {
192192
throw new CoreException(Status.error(PDEMessages.EquinoxLaunchConfiguration_oldTarget));
193193
}
194194
fAllBundles = fModels.keySet().stream().collect(Collectors.groupingBy(m -> m.getPluginBase().getId(), HashMap::new, Collectors.toCollection(ArrayList::new)));
195-
196-
super.preLaunchCheck(configuration, launch, monitor);
195+
return fModels.keySet();
197196
}
198197

199198
@Override

ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public class JUnitLaunchConfigurationDelegate extends org.eclipse.jdt.junit.laun
128128

129129
@Override
130130
public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode) throws CoreException {
131-
IVMInstall launcher = VMHelper.createLauncher(configuration);
131+
IVMInstall launcher = VMHelper.createLauncher(configuration, fModels.keySet());
132132
return launcher.getVMRunner(mode);
133133
}
134134

@@ -279,7 +279,7 @@ protected void collectExecutionArguments(ILaunchConfiguration configuration, Lis
279279
programArgs.add("-testpluginname"); //$NON-NLS-1$
280280
programArgs.add(testPlugin.getId());
281281

282-
IVMInstall launcher = VMHelper.createLauncher(configuration);
282+
IVMInstall launcher = VMHelper.createLauncher(configuration, fModels.keySet());
283283
boolean isModular = JavaRuntime.isModularJava(launcher);
284284
if (isModular) {
285285
VMHelper.addNewArgument(vmArguments, "--add-modules", "ALL-SYSTEM"); //$NON-NLS-1$//$NON-NLS-2$
@@ -412,7 +412,7 @@ public File getWorkingDirectory(ILaunchConfiguration configuration) throws CoreE
412412

413413
@Override
414414
public Map<String, Object> getVMSpecificAttributesMap(ILaunchConfiguration configuration) throws CoreException {
415-
return LaunchArgumentsHelper.getVMSpecificAttributesMap(configuration);
415+
return LaunchArgumentsHelper.getVMSpecificAttributesMap(configuration, fModels.keySet());
416416
}
417417

418418
@Override

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JREBlock.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.util.Arrays;
2020
import java.util.Comparator;
21+
import java.util.Set;
2122

2223
import org.eclipse.core.runtime.CoreException;
2324
import org.eclipse.core.runtime.IPath;
@@ -29,11 +30,14 @@
2930
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
3031
import org.eclipse.jface.window.Window;
3132
import org.eclipse.osgi.util.NLS;
33+
import org.eclipse.pde.core.plugin.IPluginModelBase;
3234
import org.eclipse.pde.internal.core.util.VMUtil;
35+
import org.eclipse.pde.internal.launching.launcher.BundleLauncherHelper;
3336
import org.eclipse.pde.internal.launching.launcher.VMHelper;
3437
import org.eclipse.pde.internal.ui.PDEUIMessages;
3538
import org.eclipse.pde.internal.ui.SWTFactory;
3639
import org.eclipse.pde.internal.ui.util.SWTUtil;
40+
import org.eclipse.pde.launching.EquinoxLaunchConfiguration;
3741
import org.eclipse.pde.launching.IPDELauncherConstants;
3842
import org.eclipse.pde.ui.launcher.AbstractLauncherTab;
3943
import org.eclipse.swt.SWT;
@@ -227,7 +231,11 @@ private void initializeJRESection(ILaunchConfiguration config) throws CoreExcept
227231
}
228232
// Try to get a default EE based on the selected plug-ins in the config
229233
if (eeId == null) {
230-
eeId = VMHelper.getDefaultEEName(config);
234+
235+
// TODO: determine this right from the config?!
236+
boolean isOSGiLaunch = config instanceof EquinoxLaunchConfiguration;
237+
Set<IPluginModelBase> plugins = BundleLauncherHelper.getMergedBundleMap(config, false).keySet();
238+
eeId = VMHelper.getDefaultEEName(plugins);
231239
}
232240
if (eeId == null) {
233241
vmInstallName = VMHelper.getDefaultVMInstallName(config);

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchAction.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,13 @@ private ILaunchConfigurationWorkingCopy refreshConfiguration(ILaunchConfiguratio
180180
Set<String> wsplugins = new HashSet<>();
181181
Set<String> explugins = new HashSet<>();
182182
Set<IPluginModelBase> listedPlugins = getModels(fProduct);
183-
allLaunchedPlugins(listedPlugins, fProduct).forEach(model -> {
183+
List<IPluginModelBase> launchedPlugins = allLaunchedPlugins(listedPlugins, fProduct).toList();
184+
for (IPluginModelBase model : launchedPlugins) {
184185
Optional<AdditionalPluginData> configuration = getPluginConfiguration(model);
185186
if (configuration.isPresent() || listedPlugins.contains(model)) {
186187
appendBundle(model.getUnderlyingResource() == null ? explugins : wsplugins, model, configuration);
187188
}
188-
});
189+
}
189190
wc.setAttribute(IPDELauncherConstants.SELECTED_WORKSPACE_BUNDLES, wsplugins);
190191
wc.setAttribute(IPDELauncherConstants.SELECTED_TARGET_BUNDLES, explugins);
191192

@@ -194,7 +195,7 @@ private ILaunchConfigurationWorkingCopy refreshConfiguration(ILaunchConfiguratio
194195
Set<IPluginModelBase> mixedProductPlugins = fProduct.getType() == ProductType.MIXED
195196
? getModelsFromListedPlugins(fProduct)
196197
: Collections.emptySet();
197-
refreshFeatureLaunchPlugins(wc, listedPlugins, mixedProductPlugins);
198+
refreshFeatureLaunchPlugins(wc, launchedPlugins, mixedProductPlugins);
198199
} else {
199200
wc.removeAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES);
200201
wc.removeAttribute(IPDELauncherConstants.SELECTED_FEATURES);
@@ -212,15 +213,15 @@ private ILaunchConfigurationWorkingCopy refreshConfiguration(ILaunchConfiguratio
212213
return wc;
213214
}
214215

215-
private void refreshFeatureLaunchPlugins(ILaunchConfigurationWorkingCopy wc, Set<IPluginModelBase> includedPlugins,
216+
private void refreshFeatureLaunchPlugins(ILaunchConfigurationWorkingCopy wc, List<IPluginModelBase> launchedPlugins,
216217
Set<IPluginModelBase> mixedProductPlugins) {
217218
FeatureModelManager featureManager = PDECore.getDefault().getFeatureModelManager();
218219
Set<String> selectedFeatures = Arrays.stream(fProduct.getFeatures()) //
219220
.map(f -> featureManager.findFeatureModel(f.getId(), f.getVersion())).filter(Objects::nonNull)
220221
.map(m -> formatFeatureEntry(m.getFeature().getId(), IPDELauncherConstants.LOCATION_DEFAULT))
221222
.collect(Collectors.toCollection(LinkedHashSet::new));
222223

223-
Set<String> additionalPlugins = allLaunchedPlugins(includedPlugins, fProduct)
224+
Set<String> additionalPlugins = launchedPlugins.stream()
224225
.map(model -> getPluginConfiguration(model)
225226
.map(c -> formatAdditionalPluginEntry(model, c.fResolution, true, c.fStartLevel, c.fAutoStart)))
226227
.flatMap(Optional::stream).collect(Collectors.toCollection(LinkedHashSet::new));

0 commit comments

Comments
 (0)