Bug 338408

Summary: Target definition editor location section losing content
Product: [Eclipse Project] PDE Reporter: Eckart Langhuth <eckart.langhuth>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, jeffmcaffer
Version: 3.7Keywords: contributed
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Screenshots
none
patch proposal
none
revised patch none

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.