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 89812 - Can not open file in editor
Summary: Can not open file in editor
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-22 09:30 UTC by Jan Jancura
Modified: 2008-12-22 14:58 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception (1.51 KB, text/plain)
2006-11-22 09:31 UTC, Jan Jancura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jancura 2006-11-22 09:30:38 UTC
Can not open JavaScript file.
Comment 1 Jan Jancura 2006-11-22 09:31:40 UTC
Created attachment 36195 [details]
exception
Comment 2 Jan Lahoda 2006-11-22 09:48:16 UTC
I do not think this is an editor bug: JEditorPane.setEditorKit is called outside
the AWT Event Dispatch Thread, which is not allowed.

I do not think it is allowed to call CloneableEditorSupport.getOpenedPanes
outside the AWT, either.
Comment 3 Jan Jancura 2006-11-22 10:06:33 UTC
There should be some notice in JavaDoc for
CloneableEditorSupport.getOpenedPanes, in this case, and some AssertException too.
Comment 4 Petr Nejedly 2006-11-23 12:49:23 UTC
J have updated the documentation but haven't enabled the assertion yet, as
ToggleBreakpoint action, excercised during commit validation calls the method
from RequestProcessor, which is wrong.
Reassigning to debugger to fix their usage.
Once fixed, please reassing back so I can enable the assertion w/o disturbing
commit validation.
Comment 5 Martin Entlicher 2006-11-23 14:15:40 UTC
Hmm, original Javadoc of getOpenedPanes() does not say anything about threading,
so I guess that this is an incompatible API change, right?

It will take some time to go through all usages, it's definitely not only
ToggleBreakpointActionProvider.
Comment 6 Petr Nejedly 2006-11-23 15:55:26 UTC
It didn't, yet it had to call into swing in some cases and it proved to be unsafe.
In case I don't assert directly in the method, you may get much more random and
harder to spot assertion failure from deeper stack, like in this case.
Comment 7 Martin Entlicher 2006-11-27 03:27:43 UTC
I understand. But I still think, that the API should mention that this must be
called in AWT.
Comment 8 Petr Nejedly 2006-11-27 09:18:25 UTC
It does so now.
Comment 9 Martin Entlicher 2006-11-27 19:56:56 UTC
O.K. So it's assured now that debugger calls it in AWT only. So the assertions
can be enabled now, moving back to openide/editor.

/cvs/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/EditorContextImpl.java,v
 <--  EditorContextImpl.java
new revision: 1.3; previous revision: 1.2

/cvs/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/ToolTipAnnotation.java,v
 <--  ToolTipAnnotation.java
new revision: 1.2; previous revision: 1.1
Comment 10 Petr Nejedly 2007-01-02 13:55:20 UTC
assert enabled:
openide/text/src/org/openide/text/CloneableEditorSupport.java,v1.27
Comment 11 Marian Mirilovic 2007-01-11 20:57:21 UTC
verified - assertion works and some other issues have been already reported
against appropriate modules. I would ask for better message , the current one
"AWT" is really not much descriptive - issue 92379.