### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.launching Index: src/org/eclipse/pde/internal/launching/launcher/LaunchConfigurationHelper.java =================================================================== RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/LaunchConfigurationHelper.java,v retrieving revision 1.5 diff -u -r1.5 LaunchConfigurationHelper.java --- src/org/eclipse/pde/internal/launching/launcher/LaunchConfigurationHelper.java 28 May 2010 19:40:53 -0000 1.5 +++ src/org/eclipse/pde/internal/launching/launcher/LaunchConfigurationHelper.java 23 Sep 2010 15:23:20 -0000 @@ -37,6 +37,9 @@ private static final String PROP_P2_DATA_AREA = "eclipse.p2.data.area"; //$NON-NLS-1$ private static final String DEFAULT_PROFILE_NAME = "SelfHostingProfile"; //$NON-NLS-1$ + private static String PRODUCT_PROPERTY = "eclipse.product"; //$NON-NLS-1$ + private static String APPLICATION_PROPERTY = "eclipse.application"; //$NON-NLS-1$ + /** * The p2 data area will be set to a directory with this name inside the configuration folder */ @@ -91,13 +94,15 @@ Properties properties = null; // if we are to generate a config.ini, start with the values in the target platform's config.ini - bug 141918 if (configuration.getAttribute(IPDELauncherConstants.CONFIG_GENERATE_DEFAULT, true)) { + String appID = configuration.getAttribute(IPDELauncherConstants.APPLICATION, TargetPlatform.getDefaultApplication()); properties = TargetPlatformHelper.getConfigIniProperties(); // if target's config.ini does not exist, lets try to fill in default values if (properties == null) properties = new Properties(); - // keep properties only if we are launching the default product (bug 175437) - else if (productID == null || !productID.equals(properties.get("eclipse.product"))) //$NON-NLS-1$ + // clear properties only if we are NOT launching the default product or app (bug 175437, bug 315039) + else if ((productID != null && !productID.equals(properties.get(PRODUCT_PROPERTY)) || (appID != null && !appID.equals(properties.get(APPLICATION_PROPERTY))))) { properties.clear(); + } // if target's config.ini has the osgi.bundles header, then parse and compute the proper osgi.bundles value String bundleList = properties.getProperty(PROP_OSGI_BUNDLES); if (bundleList != null) @@ -210,7 +215,7 @@ */ private static String computeOSGiBundles(String bundleList, Map bundles, Map bundlesWithStartLevels) { - // if p2 and only simple configurator and + // if p2 and only simple configurator and // if simple configurator isn't selected & isn't in bundle list... hack it // if using p2's simple configurator, a bundles.txt will be written, so we only need simple configurator in the config.ini