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

Bug 319924

Summary: Need to use ReferencedComponent instead of DependentObject in order to set archive name
Product: [WebTools] WTP Java EE Tools Reporter: Hari Shankar <hshanka>
Component: jst.j2eeAssignee: Hari Shankar <hshanka>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, david_williams, jsholl
Version: unspecifiedFlags: david_williams: pmc_approved+
hshanka: pmc_approved? (raghunathan.srinivasan)
hshanka: pmc_approved? (naci.dai)
deboer: pmc_approved+
hshanka: pmc_approved? (neil.hauge)
hshanka: pmc_approved? (kaloyan)
hshanka: review? (ccc)
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
patch
ccc: iplog+
updated patch
none
updated patch ccc: iplog+

Description Hari Shankar CLA 2010-07-14 17:20:15 EDT
Build Identifier: 321

In EARVirtualComponent.customizeCreatedReference, we currently do the following

if( dependentObject instanceof ICommonModule )
reference.setArchiveName(((ICommonModule) dependentObject).getUri());

This needs to be:

if( referenceComponent instanceof ReferencedComponent )
reference.setArchiveName(((ReferencedComponent)referenceComponent).getArchiveName());

The reason for doing this is that the dependentobject is not updated when the component file changes, however the archivename is set to the correct value of the uri.

Reproducible: Always
Comment 1 Hari Shankar CLA 2010-07-14 17:22:08 EDT
Created attachment 174353 [details]
patch

This patch gets the archive name from the referencedcomponent instead of the dependent object, so that we get the most updated value of the uri/archivename.
Comment 2 Chuck Bridgham CLA 2010-07-14 17:27:39 EDT
approved
Comment 3 Hari Shankar CLA 2010-07-14 17:31:07 EDT
    * Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 
This issue causes stale values to be surfaced in the UI in the deployment assembly page.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
Close and open the project.

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
This fix has been tested by checking the deployment assembly page to ensure that the updated archive name shows up. Also performed project creation/deletion scenarios to ensure nothing was broken.

    * Give a brief technical overview. Who has reviewed this fix? 
This fix has been reviewed by Chuck Bridgham.
    * What is the risk associated with this fix? 
No known risks.
Comment 4 Carl Anderson CLA 2010-07-15 11:45:00 EDT
Committed to HEAD for WTP 3.2.1 and WTP 3.3
Comment 5 Hari Shankar CLA 2010-07-15 13:27:53 EDT
Created attachment 174423 [details]
updated patch

Attaching an updated patch for the EARVirtualComponent class, that handles the case where the archive name is null. In this case, it gets the default archivename and sets it on the references.

This patch does not obsolete the previous patch, and should be applied over the previous patch.
Comment 6 Hari Shankar CLA 2010-07-15 13:28:13 EDT
Reopening the bug to take it through the approval process.
Comment 7 Hari Shankar CLA 2010-07-15 13:32:24 EDT
Created attachment 174425 [details]
updated patch

updating the patch.
Comment 8 Carl Anderson CLA 2010-07-15 14:38:18 EDT
Committed to HEAD for WTP 3.2.1 and WTP 3.3