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

Bug 314362

Summary: <library-directory> element is appended to application.xml when Deployment Assembly page is opened
Product: [WebTools] WTP Java EE Tools Reporter: Aidyl Kareh <amkareh>
Component: jst.j2eeAssignee: Aidyl Kareh <amkareh>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: amkareh, ccc, jsholl, raghunathan.srinivasan
Version: 3.2Flags: jsholl: pmc_approved? (david_williams)
raghunathan.srinivasan: pmc_approved+
jsholl: pmc_approved? (naci.dai)
deboer: pmc_approved+
jsholl: pmc_approved? (neil.hauge)
jsholl: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2 RC3   
Hardware: PC   
OS: Windows Vista   
Whiteboard: PMC_approved
Attachments:
Description Flags
Proposed Patch none

Description Aidyl Kareh CLA 2010-05-25 17:17:57 EDT
Build Identifier: WTP 3.2

Opening the 'Deployment Assembly' preference page for an EAR project and clicking 'ok' to close it currently adds a library-directory node to the application.xml file even when the library directory is set to the default value. When the 'Deployment Assembly' preference page has '/lib' as its EAR library directory value, no node should be added to the application.xml file since this is the default value. This node should only be present in the DD if the user changes it to a different value. Also, if the user sets it to lib, it should be cleared from the DD.

Reproducible: Always

Steps to Reproduce:
1. Create a EAR with DD and all the default modules.
2. Right-click on the EAR project and select 'Properties'. 
3. Open the 'Deployment Assembly' preference page.
4. Click OK (closes preference page without making changes)
5.- The following library-directory element is appended to the application.xml:
       <library-directory>/lib</library-directory>
Comment 1 Aidyl Kareh CLA 2010-05-25 17:22:27 EDT
Created attachment 169905 [details]
Proposed Patch

This patch modifies the EarModuleDependenciesPropertyPage.updateLibDir() method to add an extra check so that if the library directory is set to the default value, the previous value is removed and no new value is added.
Comment 2 Chuck Bridgham CLA 2010-05-26 13:33:37 EDT
approve
Comment 3 Jason Sholl CLA 2010-05-26 13:52:12 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. 

By simply opening a properties page an application.xml file is generated.  Considering the optional nature of these files in EE5 and EE6, this is bad behavior.

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

No

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

Tested with UI; the fix is only in the UI layer, so no JUnit needed.

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

Check to ensure the lib folder is not the default before setting it.  This has bee reviewed by Chuck

    * What is the risk associated with this fix? 

No
Comment 4 Jason Sholl CLA 2010-05-26 17:40:10 EDT
code checked into head for wtp 3.2 rc3