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 16794 - Closing (without saving) a design causes dataobject state confusion
Summary: Closing (without saving) a design causes dataobject state confusion
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: Sun SunOS
: P3 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-19 21:58 UTC by Torbjorn Norbye
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 Torbjorn Norbye 2001-10-19 21:58:16 UTC
I opened a java form file (.java,.form pair). Then I selected Close -
and apparently opening the file had caused it to be changed in the editor
(probably a new code generation was done), so I got a dialog asking if
I wanted to save the file.  I selected "No".  However, in the explorer
the java node is now marked needing comilation (the little 1's and 0's badge).
So I selected "Compile". But the output window told me the file does not
need to be compiled (which I expected). But the icon is still showing the
needs compilation badge.
Comment 1 Tomas Pavek 2001-10-22 14:41:43 UTC
This happens with any java file.
Not a form issue - reassigning...
Comment 2 Svata Dedic 2001-10-24 18:53:13 UTC
There's a inconsistency between isModified() on the DataObject and
presence of SaveCookie. IMO strictly speaking, SaveCookie should not
be present if the DataObject.isModified() == false. For a short period
of time, that is not true - the DataObject is first turned to
unmodified then the SaveCookie is revoked.

Peter, can you tell me why does CloneableEditorSupport.canClose() call
env.unmarkModified() instead of CES.notifyUnmodified() ? the
notifyUnmodified() is called after a save, or when the Undo queue is
empty (reaches the save point) -- why it is not called in this case,
if all modifications to the document are rejected ?
Comment 3 Peter Zavadsky 2001-10-25 10:24:27 UTC
Svata, I removed the piece of code which called env.unmarkModified
from canClose. Hope the change will survive (guess it was added before
just to avoid some cycling calls, but should work now), so you will
get the called notifyUnmodified afterwards. I tries it and seems to work.

Chnage:
openide/../openide/text/CloneableEditorSupport.java [1.44]
Comment 4 Svata Dedic 2001-10-25 13:30:48 UTC
Fixed in trunk.

/cvs/java/src/org/netbeans/modules/java/JavaCompilerType.java,v  <-- 
JavaCompilerType.java
new revision: 1.31; previous revision: 1.30
Comment 5 Jan Becicka 2001-11-06 16:54:26 UTC
Verified
Comment 6 Quality Engineering 2003-07-01 13:18:52 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.