Bug 225111 - Generator writes repository many times
Summary: Generator writes repository many times
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2008-04-01 10:43 EDT by John Arthorne CLA
Modified: 2008-04-04 10:58 EDT (History)
0 users

See Also:


Attachments
patch (2.12 KB, patch)
2008-04-03 11:03 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2008-04-01 10:43:03 EDT
Generator.generateBundleConfigIUs loops over all bundles, and creates a CU for each bundle that needs one. It then adds them to the repository one at a time:

  metadataRepository.addInstallableUnits(new IInstallableUnit[] {cu});

It should instead gather the CUs to add, and then add them all to the repository at once outside the loop. Otherwise, the repository file is being written once for each generated CU.
Comment 1 DJ Houghton CLA 2008-04-03 11:03:03 EDT
Created attachment 94735 [details]
patch

Here is a potential patch. Note there was a comment in the original code about making sure the CUs are added before the product query is run but I don't see a product query in that method. Is the comment out of date?
Comment 2 John Arthorne CLA 2008-04-03 11:07:39 EDT
The product query happens much later, in createProductIU. The comment is still relevant.
Comment 3 DJ Houghton CLA 2008-04-04 10:58:03 EDT
Ok, I've resurrected the comment and added a bit more info and released the patch.
Closing.