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 28537 - JSP fires many events (measured at completion support)
Summary: JSP fires many events (measured at completion support)
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: _ rkubacki
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 27785
  Show dependency tree
 
Reported: 2002-11-06 17:44 UTC by _ pkuzel
Modified: 2004-03-02 10:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Four registration traces (9.08 KB, text/plain)
2002-11-21 22:42 UTC, _ pkuzel
Details
A editor patch that exposes this bug (897 bytes, patch)
2003-02-26 11:08 UTC, _ pkuzel
Details | Diff
patch for JSP syntax module (2.08 KB, patch)
2003-02-26 15:31 UTC, _ rkubacki
Details | Diff
listeners registered to JSP document (1.30 KB, text/plain)
2003-02-26 15:33 UTC, _ rkubacki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2002-11-06 17:44:28 UTC
JSP text editor produces some events 4 times if
measured at editor.ext.Completion listeners. The
completion listeners get for four times all
document and caret events.

It's odd.
Comment 1 _ pkuzel 2002-11-06 17:45:57 UTC
It may affect issue 27785 for JSPs.
Comment 2 Petr Jiricka 2002-11-07 11:52:14 UTC
Petr, can you please be more specific and describe what 
events are fired, when exactly, and include stack trace if 
you have one ?

I am afraid I don't know what exactly you mean 
by "measured at editor.ext.Completion listeners".

Thanks
Petr
Comment 3 _ pkuzel 2002-11-21 22:40:59 UTC
org.netbeans.editor.ext.Completion$1$CompletionCaretListener.caretUpdate(Completion.java:147)   
org.netbeans.editor.ext.Completion$1$CompletionDocumentListener.insertUpdate(Completion.java:122)   
  
Traces are identical, it means that listeners 
are registere multiple times. They are. 
ExtEditorUI.COMPONENT_PROPERTY propery change 
is fired 4 times, its handler registers above 
listeners. See attachement. 
Comment 4 _ pkuzel 2002-11-21 22:42:05 UTC
Created attachment 8016 [details]
Four registration traces
Comment 5 _ rkubacki 2002-12-12 17:44:50 UTC
From the stack stace and source of o.n.e.ext.Completion I see that
editor simulates PCE in constructor of Completion. Because JSP
completion is special one encapsulating HTML and Java completion
together with some aditional features it looks OK that several objects
is created. How often this happens?
Comment 6 _ pkuzel 2002-12-16 10:23:47 UTC
On every key stroke.
Comment 7 _ rkubacki 2003-01-13 12:18:52 UTC
Tegal planning
Comment 8 _ rkubacki 2003-02-17 12:39:54 UTC
http://web.netbeans.org/source/browse/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/RestoreColoring.java.diff?r1=1.3&r2=1.4

One quarter reduced (no NbJavaCompletion that is replaced with
JspJavaCompletion that extends it). 

I don't know how to supress events generated from HTMLCompletion and
extended JavaCompletion to be fired when we actually need only the
last one that delegates to them.
Comment 10 _ pkuzel 2003-02-26 11:07:18 UTC
It's worse than I have expected. DocumentListeners duplicates itself
on every key stroke! A will attach the test path.
Comment 11 _ pkuzel 2003-02-26 11:08:39 UTC
Created attachment 9152 [details]
A editor patch that exposes this bug
Comment 12 _ rkubacki 2003-02-26 12:11:34 UTC
Sorry but your patch doesn't compile (getDocumentListeners() acnnot be
resolved)
Comment 13 _ pkuzel 2003-02-26 13:17:37 UTC
Hint JDK 1.4.1
Comment 14 _ pkuzel 2003-02-26 13:28:25 UTC
All listeners are of the same instance. It would be worthy to add in
editor's BaseDocument a check that would prevent it pointing to culprit.
Comment 15 _ rkubacki 2003-02-26 15:29:30 UTC
Another hint - print listeners instances rather then whole array
several times ;-)

I will attach listeners registered to JSP file and short patch
eliminating too many HtmlSyntaxSupport objects registered.
Comment 16 _ rkubacki 2003-02-26 15:31:59 UTC
Created attachment 9173 [details]
patch for JSP syntax module
Comment 17 _ rkubacki 2003-02-26 15:33:09 UTC
Created attachment 9174 [details]
listeners registered to JSP document
Comment 18 _ rkubacki 2003-02-27 14:21:37 UTC
patch commited
http://web.netbeans.org/source/browse/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspSyntaxSupport.java.diff?r1=1.10&r2=1.11

There are probably still too many listeners and we will need further
investigation how to eliminate some of them.

Julian can you check that JSP editor still works for your documents?
Comment 19 jsinai 2003-03-14 16:11:05 UTC
Seems to work fine.

Julian
Comment 20 _ rkubacki 2003-03-17 08:12:02 UTC
thanks Julian.
Comment 21 Martin Schovanek 2004-03-02 10:27:51 UTC
v