Bug 329308 - .launch files unconditionally rewritten after being opened in the run configuration dialog
Summary: .launch files unconditionally rewritten after being opened in the run configu...
Status: CLOSED DUPLICATE of bug 309701
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 327722 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-02 18:42 EDT by Eric Jain CLA
Modified: 2011-03-11 13:21 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jain CLA 2010-11-02 18:42:31 EDT
Build Identifier: I20101028-1441

Opening a run configuration (that has been stored as a "shared file") in the run configuration dialog is enough to make Eclipse rewrite the corresponding .launch file. This is especially annoying when keeping such a file under version control as the list of "selected_target_plugins" is reshuffled randomly... I'd expect the the file to remain untouched unless I make a change and hit "Apply" (or otherwise confirm that I want the change to be saved).

Reproducible: Always
Comment 1 Curtis Windatt CLA 2010-11-03 11:45:53 EDT
Needs investigation.  Most of these kinds of issues should have been fixed in 3.6.
Comment 2 Curtis Windatt CLA 2010-11-24 15:09:29 EST
Did you change the contents of your target platform?  The selected target plug-ins will be updated if the target plug-ins change.  We do this silently otherwise your launch configuration would quickly become stale if you updated your target platform.

I tried some other use cases and had no issues.  Opening the configuration doesn't change the list.  Opening the config and unchecking/checking a target plug-in does not change the list (we fixed this in 3.6).
Comment 3 Eric Jain CLA 2010-11-24 16:49:29 EST
Perhaps there is something about my target platform definition that is confusing Eclipse?

<location path="${project_loc}" type="Directory"/>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
<unit id="org.eclipse.sdk.ide" version="3.6.1.M20100909-0800"/>
<repository location="http://download.eclipse.org/eclipse/updates/3.6"/>
</location>
Comment 4 Curtis Windatt CLA 2010-11-30 16:50:30 EST
(In reply to comment #3)
> Perhaps there is something about my target platform definition that is
> confusing Eclipse?
> 
> <location path="${project_loc}" type="Directory"/>
> <location includeAllPlatforms="false" includeMode="planner"
> type="InstallableUnit">
> <unit id="org.eclipse.sdk.ide" version="3.6.1.M20100909-0800"/>
> <repository location="http://download.eclipse.org/eclipse/updates/3.6"/>
> </location>


If you use the project_loc variable without a resource specified it resolves based on the selection.  Perhaps your target is resolving to different things at different time causing the contents of the launch to change.
Comment 5 Curtis Windatt CLA 2011-03-08 12:03:01 EST
Closing as WORKSFORME.  We are not able to reproduce, and the target definition provided is using a variable which may change its contents.
Comment 6 Eric Jain CLA 2011-03-08 13:31:26 EST
Just tested again with 3.6.2. Looks like .launch files are not rewritten each time I open them, but only after I open the target platform definition and do "Set as Target Platform" (after making some meaningless changes). When I then open a launch configuration, the .launch file is rewritten (i.e. the list of plugins is rearranged randomly). Note that if the list of plugins were kept in alphabetical (rather than random order) this wouldn't be an issue.
Comment 7 Dean Roberts CLA 2011-03-08 14:20:36 EST
This is related to some of the behaviour that is going on in bug 309701.  I've been looking at that defect and have added some notes.

Certainly the following steps will produce a spurious save that ends up in different versions of the launch file.  I have NOT seen the plugin re-ordering but have seen the config location change and the run levels and autostart values of plugins change.

I see this behaviour on both 3.6.2 M20110210-1200 and head of 3.7.  I have a potential fix for the configLocation problem and a good problem description of the run level changes.

Steps to reproduce:

1) Create a new launch config
2) Change the launch config name
3) Press Deselect All on the Bundles tab
4) Select a couple of Bundles
5) Press the Add Required Bundels button
6) Open the Common tab, Select Shared file and select project in your workspace
7) Apply and Close the dialog
8) Copy the created .launch file
9) Reoopen the launch confg
10) Close the launch config
11) Compare the new launch config and the copy you made in step 8

You will see that the 1st launch config has an incorrect configLocation and incorrect run and autostart values on some bundles, the 2nd launch config has this corrected configLocation and run levels.

The problem that I am seeing, in both cases, is that the config models are saved before they are updated appropriately.  After the save, the dialog input is set to the correct working model.  Code paths run that correctly set the run levels and configLocation, this dirties the editor causing the save.
Comment 8 Eric Jain CLA 2011-03-10 20:02:43 EST
*** Bug 327722 has been marked as a duplicate of this bug. ***
Comment 9 Dean Roberts CLA 2011-03-11 13:16:32 EST
This bug is a duplicate of Bug 329308.  I lack sufficient privileges to set it as a duplicate, could somebody please make the change.

I will be attaching a patch to Bug 329308 that should solve the ordering problem when changing targets as well as some other problems noted in Bug 329308 that also cause changes to show up.
Comment 10 Eric Jain CLA 2011-03-11 13:21:38 EST

*** This bug has been marked as a duplicate of bug 309701 ***