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 239622 - Form stays modified after closed
Summary: Form stays modified after closed
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 18:30 UTC by Tomas Pavek
Modified: 2013-12-19 15:59 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 Tomas Pavek 2013-12-18 18:30:34 UTC
1) Open a GUI form on design.
2) Add a component from palette.
3) Don't switch to source and close the form, choose "Discard".
4) Open the form again - it is modified.

So unless something is written to the source (document), the editor support (data object) stays modified. The GUI builder does not write anything to the document until switched to source.

I'd say this was caused by fix of bug 234791. When closing the form, CloneableEditorSupport.callNotifyUnmodified() gets called, but now there is a new check for isAlreadyModified(). Here alreadyModified is false because nothing was written to the document - and this is set only from document changes. So the call to notifyUnmodified() which would unmodify the DataObject does not happen.

I was looking for some workaround, but I cannot call setAlreadyModified(true) from form editor (FormEditorSupport). But I probably should not need to. CloneableEditorSupport seems broken if it acts according to isAlreadyModified() and ignores its official isModified() state.
Comment 1 Miloslav Metelka 2013-12-19 15:59:31 UTC
http://hg.netbeans.org/jet-main/rev/e4b371987f7d