Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 309186

Summary: [API] FlatVirtualComponent should ignore manifest references
Product: [WebTools] WTP Java EE Tools Reporter: Jason Peterson <jasonpet>
Component: jst.j2eeAssignee: Jason Peterson <jasonpet>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, david_williams, jsholl, stryker
Version: 3.2Flags: david_williams: pmc_approved+
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
ccc: pmc_approved? (deboer)
ccc: pmc_approved? (neil.hauge)
ccc: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch none

Description Jason Peterson CLA 2010-04-14 14:38:51 EDT
Currently deploy and export code use hierarchy participants to determine which references should be absorbed into the referencing component at export or deploy time.  Currently deploy is always absorbing the references and export is only doing so when the referencing component is an EAR or web project (WEB-INF/lib references).  For deploy, all Java EE references are returned and it is up to the user/client of the FlatVirtualComponent to ignore the proper references.  For export, any non binary reference that is not referenced by an EAR or web project are ignored.  This worked fine with the old module assembly page since it only allowed these.  However, the new page allows any component to contain references to other components.    

As of right now, manifest references are the only type of references that should not be absorbed/consumed.  The solution is to ignore the manifest references in the FlatVirtualComponent.  This makes sure only the proper references are published at deploy time and archived and export time.  

After talking with Rob we decided the best way to handle this is for FlatVirtualComponent to pass in a new map option/flag when calling getReferences(Map<String, Object> options).  When the new flag is used only non manifest references will be returned.
Comment 1 Jason Peterson CLA 2010-04-14 14:42:12 EDT
Created attachment 164870 [details]
patch
Comment 2 Jason Peterson CLA 2010-04-14 14:44:53 EDT
Carl, can you run the JUnit bucket on this patch?  This hits some code in both common as well as Java EE.  Should I add you as a reviewer as well Carl?
Comment 3 Chuck Bridgham CLA 2010-04-14 15:58:09 EDT
Change looks ok, but it is technically an api change so need to flip the PMC bit...

approved - and adding Carl to approval too.
Comment 4 Carl Anderson CLA 2010-04-14 23:02:08 EDT
I approve of this change.

I reran the Java EE Tools JUnits and the Server Tools JUnits, and this does not appear to cause any regressions.
Comment 5 David Williams CLA 2010-04-14 23:15:44 EDT
This sounds necessary, but can you document a bit more about "change in behavior" since when? Earlier milestone? Or last release? The latter obviously requiring more notice, updates to "new help for old friends", etc. Was this due to the "merge" of code to just have set of code for export and publish? 

Thanks,
Comment 6 Jason Peterson CLA 2010-04-15 10:10:20 EDT
The change is necessary due to the change in behavior of the new module assembly page.  I believe the work for the module assembly page started last milestone and is still ongoing.  The page now allows all Java EE project types (not just EAR and web) to add external jars, variables, project references.  These references are now added directly to the project's component file and absorbed by the project itself instead of being absorbed by the parent EAR. As of last milestone these were being absorbed by the EAR and not the child referencing them.
Comment 7 Carl Anderson CLA 2010-04-15 11:59:44 EDT
Committed to HEAD for WTP 3.2 M7