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

Bug 345961

Summary: Critical UI NPE for CONSUMES types references
Product: [WebTools] WTP Common Tools Reporter: Rob Stryker <stryker>
Component: wst.commonAssignee: Rob Stryker <stryker>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: major    
Priority: P1 CC: kaloyan
Version: 3.2.3Flags: ccc: pmc_approved? (david_williams)
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
ccc: pmc_approved? (deboer)
ccc: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+
ccc: pmc_approved? (cbridgha)
ccc: review+
Target Milestone: 3.3 RC1   
Hardware: PC   
OS: Linux   
Whiteboard: PMC_approved
Bug Depends on:    
Bug Blocks: 345963    
Attachments:
Description Flags
Patch to ignore archiveName in CONSUMED references none

Description Rob Stryker CLA 2011-05-16 10:42:55 EDT
An NPE is generated when modifying the "Deploy Path" of a CONSUMED reference in the Module Assembly Property Page. The NPE is caused by attempting to append the archiveName attribute of the virtual reference to it's runtime Path. 

The reason this causes an error is because CONSUMED type references are not required, and cannot be guaranteed to have, an archive name. Archive names are ignored for CONSUMED type references, and only the runtime path is used.

The fix is to ignore archive name on consumed references in this part of the code. This is a regression, though I have not yet had the time to identify how far back it was caused. It seems to have been introduced when optimized viewer updates were added rather than refreshing the entire view after a modify. 

This is a critical fix for an adopter (wtp-m2e integration).
Comment 1 Rob Stryker CLA 2011-05-16 10:45:16 EDT
Created attachment 195737 [details]
Patch to ignore archiveName in CONSUMED references
Comment 2 Rob Stryker CLA 2011-05-16 10:48:34 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. 

   An adopter (wtp-m2e integration) has been trying to add reference types of their own design, and this bug prevents modification of the deploy path attribute in the UI. 

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 

   A workaround is for the user to use the raw text facility to modify the component xml file at all times. This is not suitable for most cases. 

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

   The fix has been manually tested by myself. There is no junit test for the UI. 

    * Give a brief technical overview. Who has reviewed this fix? 

   If the reference is a CONSUMED type reference, the archiveName is no longer appended to the runtimePath, as per the unwritten-but-understood spec and expected behavior. 

    * What is the risk associated with this fix? 

   The risk of this bug is extremely isolated and small. I consider this a very very safe patch.
Comment 3 Carl Anderson CLA 2011-05-16 23:51:07 EDT
I approve.  Sending to PMC
Comment 4 Carl Anderson CLA 2011-05-17 00:01:00 EDT
Lowering the severity to major- it does have negative impact.  Raising the priority to P1 - we want to get this fixed.
Comment 5 Rob Stryker CLA 2011-05-17 10:33:31 EDT
This has been committed and released to 3.3.0 RC1
Comment 6 Rob Stryker CLA 2011-10-25 10:31:02 EDT
*** Bug 345963 has been marked as a duplicate of this bug. ***