Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362398 - [patch] WorkspaceProductModel load and write error
Summary: [patch] WorkspaceProductModel load and write error
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-29 08:20 EDT by Andreas Hoegger CLA
Modified: 2012-03-02 03:23 EST (History)
1 user (show)

See Also:


Attachments
proposed patch (2.98 KB, patch)
2011-10-29 08:20 EDT, Andreas Hoegger CLA
no flags Details | Diff
proposed patch (3.12 KB, patch)
2011-10-29 08:25 EDT, Andreas Hoegger CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Hoegger CLA 2011-10-29 08:20:49 EDT
Created attachment 206161 [details]
proposed patch

Having a *.product file with plugin dependencies which are not in the current target platform (not existing) and load and save it using the WorkspaceProductModel without any change. Every non-existing plugin will be marked with fragment=””.  
Furthermore it is not possible to add a fragment which is not in the current target platform. There is no setter for the fFragment attribute in ‘org.eclipse.pde.internal.core.product.ProductPlugin’. 

See the patch attachement.
Comment 1 Andreas Hoegger CLA 2011-10-29 08:25:01 EDT
Created attachment 206162 [details]
proposed patch

Sorry wrong patch attached in the first try ;)
Comment 2 Curtis Windatt CLA 2012-02-29 17:34:59 EST
I have pushed a simpler fix to master.  If the stored fragment property is an empty string, we don't write out the fragment attribute.  Thanks for reporting this!
Comment 3 Andreas Hoegger CLA 2012-02-29 18:08:30 EST
Thank you for working on that. 

The Eclipse Scout project makes huge usage of JDT/PDE also the IProductModel and its implementations. 
At the point we create a product file (using PDE API) the fragments included in this product are not yet available in the target platform. So the fragment flags would be ignored (at least not anymore empty string) at this point. Before we go and update the target platform (P2). We can not change the sequence of this tasks in order of the long time running update mechanism. 

Therefore a fix without the getter/setter for the fragment member does not really help us a lot. I also do not see any reason for having getter/setter for the id and version but not for the fragment member. Are there any issues I missed?
Comment 4 Curtis Windatt CLA 2012-03-01 11:29:43 EST
Ok, I have committed an additional fix with the getter and setter.  It also cleans up the code a bit (storing a boolean over the element string).

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=337721074d91e421919b2c26b9c04a6fe0464fc4

Reminder that IProductPlugin is internal (not API).  There are no guarantees that the methods won't change in a future release.
Comment 5 Andreas Hoegger CLA 2012-03-02 03:23:41 EST
Thank you Curtis. The change looks fine for me, well test it with M6.