Bug 338408 - Target definition editor location section losing content
Summary: Target definition editor location section losing content
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2011-02-28 08:15 EST by Eckart Langhuth CLA
Modified: 2011-03-07 12:01 EST (History)
2 users (show)

See Also:


Attachments
Screenshots (140.50 KB, application/x-zip-compressed)
2011-02-28 08:16 EST, Eckart Langhuth CLA
no flags Details
patch proposal (758 bytes, patch)
2011-02-28 08:16 EST, Eckart Langhuth CLA
no flags Details | Diff
revised patch (5.02 KB, patch)
2011-03-03 20:40 EST, Jeff McAffer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eckart Langhuth CLA 2011-02-28 08:15:07 EST
Build Identifier: Current HEAD

In the target definition editor location section a location lose its children (the resolved referenced units) after “Edit”.

The behavior is caused by an inconsistency between the IUBundleContainer objects and their related synchronizer (P2TargetUtils).
Attached patch proposal will mark the synchronizer for a TargetDefinition dirty on each set # setBundleContainers(IBundleContainer[] containers). This seems reasonable as the target definition synchronizer “knows” the internal state of related IUBundleContainer objects.  (see IUBundleContainer# synchronizerChanged()).


Reproducible: Always

Steps to Reproduce:
1. Define a target definition with at least two locations referencing some features.
2. Select a location and press “Edit”. 
3. Leave Edit dialog without a change using “Finish”.

As a result the location in the locations tree loses its children.
(See attached screenshots)
Comment 1 Eckart Langhuth CLA 2011-02-28 08:16:19 EST
Created attachment 189938 [details]
Screenshots
Comment 2 Eckart Langhuth CLA 2011-02-28 08:16:58 EST
Created attachment 189939 [details]
patch proposal
Comment 3 Curtis Windatt CLA 2011-02-28 10:05:28 EST
Jeff, can you take a look at this?
Comment 4 Jeff McAffer CLA 2011-03-03 17:25:39 EST
Just saw this bug now.  I will take a look later today.
Comment 5 Jeff McAffer CLA 2011-03-03 20:40:35 EST
Created attachment 190335 [details]
revised patch

The fix approach looks good.  I tweaked it a bit to put the mark dirty call in IUBundleContainer.associateWithTarget() rather than in TargetDefinition.  That keeps TargetDefinition clean of particulars of various containers.  It means that markDirty() will be called once for each IU container but the call is just a field set so its not a big deal.

I tested that it did indeed address the problem (thanks btw)
Comment 6 Curtis Windatt CLA 2011-03-04 11:37:45 EST
I assume that the jdt pref changes are incidental, so this is just a one line fix.
Comment 7 Curtis Windatt CLA 2011-03-04 11:46:10 EST
Fixed in HEAD.  Thanks for the contribution!
Comment 8 Jeff McAffer CLA 2011-03-07 12:01:22 EST
yes, the pref change was incidental.  Needed to do it to make the build system happy as I don't have a 1.4 VM.  Interestingly when I generated the patch I deselected that change so assumed it would not show up in the patch.  Go figure.
Thanks for taking care of this.