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 172864 - Debugger cannot call getOpenedPanes()
Summary: Debugger cannot call getOpenedPanes()
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@debugger
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
Depends on: 168415
Blocks:
  Show dependency tree
 
Reported: 2009-09-23 12:47 UTC by mklaehn
Modified: 2009-10-14 18:11 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 157644


Attachments
nps snapshot (26.83 KB, bin/nps)
2009-09-23 12:47 UTC, mklaehn
Details
nps snapshot (47.89 KB, bin/nps)
2009-10-03 22:48 UTC, dima_s_d_s
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mklaehn 2009-09-23 12:47:00 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3954-on-090919)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments:
stefan79: Opened a big java-src-file (~7500 lines)

GUEST: Started NetBeans

GUEST: Opened netbeans


Maximum slowness yet reported was 9078 ms, average is 5034
Comment 1 mklaehn 2009-09-23 12:47:06 UTC
Created attachment 88180 [details]
nps snapshot
Comment 2 Exceptions Reporter 2009-09-23 12:47:10 UTC
This issue already has 8 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157644
Comment 3 mslama 2009-09-23 13:08:25 UTC
I do not see anything suspicious. Visual part of editor initialization is performed in AWT thread. If I look deep into
snapshot most of time is spent by class loading but I do not know if we can do anything with it. There are some warm up
tasks to preload some classes but it is possible they are not yet done in this case. It looks like io is also used by
another thread so there is clash and io throughput is low. Jarda any comment?
Comment 4 mslama 2009-09-23 13:14:20 UTC
Note: Thread "Load Open Projects" also performs io. It looks like cold start so data are not in OS filesystem cache.
Comment 5 Exceptions Reporter 2009-09-25 11:45:12 UTC
This issue already has 13 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157644
Comment 6 Exceptions Reporter 2009-09-30 09:59:27 UTC
This issue already has 21 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157644
Comment 7 Exceptions Reporter 2009-09-30 15:43:41 UTC
This issue already has 24 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157644
Comment 8 Martin Entlicher 2009-10-01 11:02:04 UTC
There are apparently more different snapshots.
Those which reference EditorContextDispatcher and it's call to getOpenedPanes() are caused by workaround done because of
issue #172889. This was changed right before beta since I believe that it's more important to have working functionality
than speed. It in fact removed the fix of issue #168415.

As soon as issue #172889 is fixed, I'll remove getOpenedPanes() call again.

So please, concentrate on other cases and ignore EditorContextDispatcher.
Comment 9 dima_s_d_s 2009-10-03 22:48:15 UTC
Build: NetBeans IDE Dev (Build 200908022240)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments: 

Maximum slowness yet reported was 22406 ms, average is 6501
Comment 10 dima_s_d_s 2009-10-03 22:48:21 UTC
Created attachment 88792 [details]
nps snapshot
Comment 11 Jaroslav Tulach 2009-10-07 16:10:37 UTC
I went through 44 duplicated reports in http://statistics.netbeans.org/exceptions/detail.do?id=157644 and removed 
those that do not contain word debugger. Still 25 issues is left. That still makes this issue P2. Reassigning to 
debuggerjpda to adjust its code.

The openide.text did what it could by offering NbDocument.findRecentActivePane(...) the rest of the work needs to be 
done by debuggerjpda.
Comment 12 Martin Entlicher 2009-10-07 20:26:44 UTC
Since debugger does not call getEditorPanes() any more, it's already fixed.
Comment 13 Jaroslav Tulach 2009-10-08 09:05:03 UTC
I just tried to grep for the getOpenedPanes() calls and there still seem to be some of them (even in jpda and core 
debuggers). Can/shall those be eliminated as well?

$  grep getOpenedPanes --include "*.java" *debugger* -r
ant.debugger/src/org/netbeans/modules/ant/debugger/Utils.java:        JEditorPane[] panes = editor.getOpenedPanes();
bpel.debugger.ui/src/org/netbeans/modules/bpel/debugger/ui/action/RunToCursorUtil.java:        JEditorPane[] op = 
e.getOpenedPanes ();
bpel.debugger.ui/src/org/netbeans/modules/bpel/debugger/ui/action/RunToCursorUtil.java:        JEditorPane[] 
editorPanes = editorCookie.getOpenedPanes();
bpel.debugger.ui/src/org/netbeans/modules/bpel/debugger/ui/util/EditorUtil.java:            final JEditorPane[] panes 
= editorCookie.getOpenedPanes();
cnd.debugger.gdb/src/org/netbeans/modules/cnd/debugger/gdb/disassembly/Disassembly.java:                            if 
(editorCookie.getOpenedPanes() == null) {
debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/MethodChooser.java:                    JEditorPane[] 
openedPanes = ec.getOpenedPanes();
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/EditorContextImpl.java:                    
JEditorPane[] eps = ec.getOpenedPanes();
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/RunToCursorActionProvider.java:        //PATCH 
57824: getOpenedPanes () calls from non AWT threads can
python.debugger/src/org/netbeans/modules/python/debugger/Utils.java:    JEditorPane[] op = 
editorCookie.getOpenedPanes();
spi.debugger.ui/src/org/netbeans/modules/debugger/ui/Utils.java:        JEditorPane[] op = e.getOpenedPanes ();
spi.debugger.ui/src/org/netbeans/modules/debugger/ui/Utils.java:        JEditorPane[] op = e.getOpenedPanes ();
spi.debugger.ui/src/org/netbeans/spi/debugger/ui/EditorContextDispatcher.java:                        // 
getOpenedPanes() MUST be called on AWT.
spi.debugger.ui/src/org/netbeans/spi/debugger/ui/EditorContextDispatcher.java:                    // getOpenedPanes() 
MUST be called on AWT.
Comment 14 Martin Entlicher 2009-10-08 11:11:26 UTC
I've checked usages of CloneableEditorSupport.getOpenedPanes() before I've closed this and got no results.

I've forgot about EditorCookie.getOpenedPanes() - this is used at several places.
Should not this method be marked as deprecated if it must not be called?