Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 224840 - Can not cancel changes while closing datapool editor
Summary: Can not cancel changes while closing datapool editor
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 231876 (view as bug list)
Depends on: 202695
Blocks:
  Show dependency tree
 
Reported: 2008-03-31 04:07 EDT by Xin Ying Huang CLA
Modified: 2016-05-05 10:32 EDT (History)
5 users (show)

See Also:
paulslau: review+


Attachments
Fix this issue and update a patch (7.59 KB, patch)
2008-04-02 05:31 EDT, Xin Ying Huang CLA
no flags Details | Diff
Patch V2. (11.67 KB, patch)
2008-04-02 06:49 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xin Ying Huang CLA 2008-03-31 04:07:03 EDT
Build ID: tptp45 i6

Steps To Reproduce:
1. Open an datapool editor in eclipse workbench .
2. Do some actions ,such encrypt an column ,change it's  cell value
3. DO not click "save " button in eclipse Menu .
4. Click "close" datapool editor .
5. System prompt user to select " save" or "no" or " cancel"  
6. Click "no" to close editor to escape changing  and close it directly .
7. Open datapool editor again and find the changes is still saved .


More information:
Comment 1 Paul Slauenwhite CLA 2008-04-01 07:08:07 EDT
This defect is caused by the addition of the org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method to the DatapoolEditorPart for enhancement 202695.  When the editor is saved (save file menu, save toolbar button, CTRL-S, or closing the editor and clicking Yes to save changes), the org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.save(IProgressMonitor) method is called.  The org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method also saves the datapool again (as well as sets the challenge to null) when the editor is disposed if no columns are encrypted.  

Xin, why do we need to set the challenge to null in the org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method?  If we remove the line that saves the datapool in this method (e.g. ((DatapoolEditorExtension)this.getEditorExtension()).save();), the datapool will be saved by the org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.save(IProgressMonitor) method before the editor is disposed (and the org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method is called) so if setting the challenge to null is required, please find another location to do this operation.

When you have a fix, please attach it to this defect as a patch and set the review flag to '? paules@ca.ibm.com' so I can review.

Thanks.
Comment 2 Paul Slauenwhite CLA 2008-04-01 07:36:52 EDT
Updated hours worked for triage.
Comment 3 Xin Ying Huang CLA 2008-04-01 22:56:24 EDT
(In reply to comment #1)
> This defect is caused by the addition of the
> org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method
> to the DatapoolEditorPart for enhancement 202695.  When the editor is saved
> (save file menu, save toolbar button, CTRL-S, or closing the editor and
> clicking Yes to save changes), the
> org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.save(IProgressMonitor)
> method is called.  The
> org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method
> also saves the datapool again (as well as sets the challenge to null) when the
> editor is disposed if no columns are encrypted.  
> Xin, why do we need to set the challenge to null in the
> org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method?
>  If we remove the line that saves the datapool in this method (e.g.
> ((DatapoolEditorExtension)this.getEditorExtension()).save();), the datapool
> will be saved by the
> org.eclipse.hyades.test.ui.editor.extension.BaseEditorExtension.save(IProgressMonitor)
> method before the editor is disposed (and the
> org.eclipse.hyades.test.ui.internal.editor.DatapoolEditorPart.dispose() method
> is called) so if setting the challenge to null is required, please find another
> location to do this operation.
> When you have a fix, please attach it to this defect as a patch and set the
> review flag to '? paules@ca.ibm.com' so I can review.
> Thanks.



Paul :

  My purpose to set challenge to null is that I use challenge to check if this datapool is encrypted or not . if it's value is null then means is not encrypted . I have to set challenge to null after user unencrypted all encrypted columns in this datapool and try to close this datapool . 

  Looks like I have to move my actions in dispose() into ((DatapoolEditorExtension)this.getEditorExtension()).save();), 

 I will try it ,any question , I will contact you ,thanks !
Comment 4 Xin Ying Huang CLA 2008-04-02 05:31:32 EDT
Created attachment 94506 [details]
Fix this issue and update a patch

Move judgement about if chanllenge is null into Datapooltable class ,then do not need do this judgement in dispose() .
Comment 5 Paul Slauenwhite CLA 2008-04-02 06:49:07 EDT
Created attachment 94517 [details]
Patch V2.
Comment 6 Paul Slauenwhite CLA 2008-04-02 06:49:37 EDT
Reviewed (see patch v2).
Comment 7 Paul Slauenwhite CLA 2008-04-09 16:03:31 EDT
Patch checked in to CVS (HEAD).
Comment 8 Paul Slauenwhite CLA 2008-05-13 14:05:49 EDT
*** Bug 231876 has been marked as a duplicate of this bug. ***
Comment 9 Xin Ying Huang CLA 2008-05-15 01:55:32 EDT
verified and it's ok to close now .