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

Bug 312444

Summary: Java Persistence errors/warnings preferences Restore Defaults does not always work
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Nan Li <nan.n.li>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, jolene.moffitt, neil.hauge, paul.fullbright
Version: 2.3Flags: david_williams: pmc_approved+
paul.fullbright: pmc_approved? (raghunathan.srinivasan)
paul.fullbright: pmc_approved? (naci.dai)
paul.fullbright: pmc_approved? (deboer)
paul.fullbright: pmc_approved? (neil.hauge)
paul.fullbright: pmc_approved? (kaloyan)
paul.fullbright: pmc_approved? (cbridgha)
paul.fullbright: review+
Target Milestone: 3.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch neil.hauge: iplog+

Description Karen Butzke CLA 2010-05-11 11:01:55 EDT
Select Window->Preferences->Java Persistence->Errors/Warnings.
Change some of the preferences and then press the 'Restore Defaults' button.
You'll notice that the defaults appear again.
Now change some of the preferences press 'Apply' and then press 'Restore Defaults'
The preferences do not appear to be set back to default in the combos.
If you press OK on the dialog and come back you will see that the defaults were restored.
Comment 1 Paul Fullbright CLA 2010-05-13 14:38:43 EDT
Yes, it appears as though "Restore Defaults" only restores to what is saved (i.e. un"applied"), not the actual default.
Comment 2 Nan Li CLA 2011-05-03 16:45:56 EDT
Created attachment 194647 [details]
proposed patch

The changes of JptJpaCorePlugin class are for using the new methods instead of the deprecated ones. They are separate from the fixes of this bug.
Comment 3 Paul Fullbright CLA 2011-05-03 17:47:45 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 fixes eclipse non-standard behavior.  Current behavior restores preferences to pre-edit state rather than default state.


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

     No workaround available, other than deleting keys from prefs file.


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

     This patch has been tested by both Nan and I.  Preferences revert to default settings (and keys are removed from prefs file).


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

     I have reviewed this patch.


    * What is the risk associated with this fix? 

     No risk.  No changes to API or UI.  Changes in API usage are recommended changes (which has the exact same effect as before).  Changes to preference default reverting simply ignore case that the preference has been set (which was previous behavior.)
Comment 4 Paul Fullbright CLA 2011-05-04 11:52:01 EDT
committed for RC1
Comment 5 Jolene Moffitt CLA 2011-05-31 13:43:03 EDT
Verified in Build I-3.3.0RC2-20110520234832

Verified Preferences are returned to Default values. See the link to
view test steps for verification.  http://wiki.eclipse.org/Dali_3.0_RC1