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 52493 - Each key press in editor runs notifyModified()
Summary: Each key press in editor runs notifyModified()
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-12-15 14:21 UTC by Antonin Nebuzelsky
Modified: 2008-12-22 16:17 UTC (History)
2 users (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 Antonin Nebuzelsky 2004-12-15 14:21:04 UTC
Analysis of activities invoked with a keystroke
revealed that notifyModified() is called each time.

It forwards the notification throughout the whole
stack although the document is already marked
modified. It means stat()ing the file on each
keystroke. It can be really troublesome on slow
filesystems, e.g. on network.
Comment 1 Miloslav Metelka 2004-12-16 11:14:27 UTC
The editor does not call notifyModified() directly. Editor fires
registered DocumentListeners and one of them then calls the
notifyModified() in openide/text. AFAIK this was always the case and
notifyModified() only did the actual work (marking the file with *
etc.) if the document was not modified previously (there should be
"alreadyModified" flag).
Anyway reassigning to openide/editor for evaluation.
Comment 2 Jaroslav Tulach 2005-01-05 14:19:23 UTC
Another problem is that the notifyModified is called under the
document lock, which prevents future calls to mdr. I am going to
change the flow to call the method just once and without holding any
locks.
Comment 3 Petr Nejedly 2005-01-05 15:11:02 UTC
You mean the issue 51872, right?
Comment 4 Jaroslav Tulach 2005-01-05 17:06:51 UTC
openide$ cvs -q ci -m "#52493: CES.notifyModified is called just once
and attention is also paid to its return value - if it is false the
next undo will be reverted"


Checking in src/org/openide/text/CloneableEditorSupport.java;
/cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v  <-- 
CloneableEditorSupport.java
new revision: 1.140; previous revision: 1.139
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/openide/test/unit/src/org/openide/text/NotifyModifiedTest.java,v
done
Checking in test/unit/src/org/openide/text/NotifyModifiedTest.java;
/cvs/openide/test/unit/src/org/openide/text/NotifyModifiedTest.java,v
 <--  NotifyModifiedTest.java
initial revision: 1.1
done
Checking in test/unit/src/org/openide/text/UndoRedoCooperationTest.java;
/cvs/openide/test/unit/src/org/openide/text/UndoRedoCooperationTest.java,v
 <--  UndoRedoCooperationTest.java
new revision: 1.5;