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

Bug 311909

Summary: Project preferences UI, "restore defaults" button skips 2 fields
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, jsholl, neil.hauge
Version: 3.2Flags: hshanka: pmc_approved? (david_williams)
hshanka: pmc_approved? (raghunathan.srinivasan)
hshanka: pmc_approved? (naci.dai)
hshanka: pmc_approved? (deboer)
neil.hauge: pmc_approved+
hshanka: pmc_approved? (kaloyan)
cbridgha: review+
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
Patch none

Description Hari Shankar CLA 2010-05-06 11:19:17 EDT
Build Identifier: 32

Restore defaults should fill in default values.
                     EAR content :  empty
                     Ejb:   ejbModule, ejbModule
                     Web :  src, /WebContent/WEB-INF/classes/, WebContent/
                     Appclient:   appClientModule, appClientModule
                     Connector:  connectorModule,  connectorModule
                     Utility :  src, src
The result is:

EJB and Application Client projects' output folder fields are not restored to defaults.

Reproducible: Always
Comment 1 Hari Shankar CLA 2010-05-06 11:20:59 EDT
Created attachment 167322 [details]
Patch

The issue was that we were getting the current instead of the default value during initialization, and setting it to the default value. This patch fixes the issue by getting the values from the default scope for initializing the default values.

I have also added a getDefaultBoolean method for consistency with the older preferences class and future use.
Comment 2 Chuck Bridgham CLA 2010-05-06 15:23:20 EDT
approved
Comment 3 Hari Shankar CLA 2010-05-12 12:16:42 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 bug prevents the 'Restore Defaults' button from completely performing the associated functionality.

    * Is there a work-around? If so, why do you believe the work-around is insufficient? 
Manually edit the fields that are not restored. This may result in support tickets being opened against adopter products.

    * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 
Fix was tested by using the restore defaults button on windows. Ensured that all the default values are restored. Also several other operations such as project creation for various modules were tested to ensure that the defaults for other scenarios are not affected.

    * Give a brief technical overview. Who has reviewed this fix? 
This fix has been reviewed by Chuck Brdigham
    * What is the risk associated with this fix? 
There is no risk associated with this fix.
Comment 4 Jason Sholl CLA 2010-05-12 15:19:57 EDT
code checked into head for WTP 3.2 RC1