This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 97588 - cancel not removing unsaved changes
Summary: cancel not removing unsaved changes
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Grebac
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-09 19:25 UTC by tamiro
Modified: 2008-07-16 21:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tamiro 2007-03-09 19:25:12 UTC
Harsha found this problem with 2.24. I verified it with 2.25.
Harsha reports:
When I use netbeans WSIT plugin and edit some webservice attributes, but then
press the cancel button, if I have the corresponding wsit file open in the
editor, the changes remain in the file with a "*" displayed next to the file
name indicating it is not saved. Suppose I want to save this file, there is no
way to do it, because the save button is disabled. If I close the file, there is
no warning that the changes will be lost. I would expect as a user that when I
press cancel button, my changes should disappear from the file even if it is
open. Or there should be an option to save or discard the changes manually
afterwards. In the absence of either of these, the user will get confused.
Comment 1 Martin Grebac 2007-03-12 19:00:19 UTC
This appears to be a problem of xml/wsdl modules or editor itself, as we are
cancelling the changes and call dataObject.setDirty(false) at the end, which
appropriately works on Saveall buttons
Comment 2 Shivanand Kini 2007-10-20 01:21:21 UTC
This does not seem to occur anymore.
Comment 3 jlautz 2008-02-06 14:38:52 UTC
Reproduceable in 
Product Version: NetBeans IDE Dev (Build 200802041203)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: SunOS version 5.10 running on x86; ISO646-US; en (nb)
Userdir: /Users/lautz/.netbeans/dev

I think the following scenario reflects what the original reporter was seeintg:

1. Define a Web application.
2. Define a new Web service.
3. Define a simple operation, like a simple echo that takes in input String parm and returns the same String.
4. Click any checkbox under Quality of Service.
5. Find the wsit*.xml file under Web pages/WEB-INF, and open it in the xml editor.
6. Choose the Advanced button under Quality of Service.
7. Click the Cancel button in the dialog.

==> Note that the wsit*.xml file thinks it's been changed.
Comment 4 Shivanand Kini 2008-02-07 01:36:00 UTC
I dont think this is a problem with wsdl editor. I can open the WSIT editor and click on operation and then change it to
mandatory.
I see in the wsdl source view, the new components are added and when I cancel the changes, nothing changes in the source
view. The WSIT editor does not seem to be rolling back the changes.
Comment 5 Roderico Cruz 2008-02-19 19:05:47 UTC
Reassigning to Martin
Comment 6 Martin Grebac 2008-02-29 15:19:38 UTC
 Hmm, I just checked through the code, and WSIT editor does undo the changes (there are no changes in the file, also
diff doesn't show anything), and it also calls dataObject.setModified(false) to assure it. However, the status of the
file in the editor doesn't change.
 That's why I assume the problem is below WSIT editor. If you think otherwise, please provide input on what's wrong with
the underlying model on your side after these changes happen.
Comment 7 Samaresh Panda 2008-03-26 23:16:50 UTC
I tried as per the second instruction from jlautz and don't see any issues here. In any case, if some web service model
is mutating a xml document, I don't understand why should xml be responsible for saving, not saving, canceling. Please
debug further.
Comment 8 Martin Grebac 2008-06-27 12:17:19 UTC
I put in a workaround fix for this - at least the jlautz steps should have been fixed. It does not fix the main cause of
the problem (most likely in XML editor itself as I described initially), but it appears to work.
Comment 9 tonybeckham 2008-07-10 22:49:15 UTC
I see that the file under Web pages/WEB-INF has the "*" indicating it has been modified and should be saved.  This is
present once any check box is selected then deselected after selecting the advanced button for a web service.

Product Version: NetBeans IDE Dev (Build 200807100006)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)
Comment 10 Martin Grebac 2008-07-14 15:05:16 UTC
Ah, sorry, forgot to push to main repo. It was pushed just now.
Comment 11 tonybeckham 2008-07-16 21:13:58 UTC
Fix Verified

Product Version: NetBeans IDE Dev (Build 200807101204)
Java: 1.6.0_05; Java HotSpot(TM) 64-Bit Server VM 1.6.0_05-b13-52
System: Mac OS X version 10.5.4 running on x86_64; MacRoman; en_US (nb)