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 64438 - Assert in CompletionImpl.stateChanged
Summary: Assert in CompletionImpl.stateChanged
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Diff (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Roskanin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-15 14:32 UTC by _ pkuzel
Modified: 2005-09-15 18:03 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 _ pkuzel 2005-09-15 14:32:51 UTC
From Versioning view I double-clicked modified file and got:

java.lang.AssertionError
	at
org.netbeans.modules.editor.completion.CompletionImpl.stateChanged(CompletionImpl.java:270)
	at org.netbeans.editor.Registry.fireChange(Registry.java:489)
	at org.netbeans.editor.Registry.activate(Registry.java:231)
	at org.netbeans.editor.BaseTextUI.installUI(BaseTextUI.java:228)
	at javax.swing.JComponent.setUI(JComponent.java:652)
	at javax.swing.text.JTextComponent.setUI(JTextComponent.java:298)
	at org.netbeans.editor.BaseKit.install(BaseKit.java:486)
	at javax.swing.JEditorPane.setEditorKit(JEditorPane.java:959)
	at javax.swing.JEditorPane.setContentType(JEditorPane.java:886)
	at
org.netbeans.modules.diff.builtin.visualizer.DiffViewImpl.setMimeType1(DiffViewImpl.java:635)
	at
org.netbeans.modules.diff.builtin.visualizer.DiffViewImpl.<init>(DiffViewImpl.java:132)
	at org.netbeans.modules.diff.builtin.DefaultDiff.createDiff(DefaultDiff.java:112)
	at
org.netbeans.modules.versioning.system.cvss.ui.actions.diff.DiffMainPanel$DiffPrepareTask.run(DiffMainPanel.java:517)
	at org.openide.util.Task.run(Task.java:207)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)
Comment 1 _ pkuzel 2005-09-15 14:33:56 UTC
100% reproducible. No diffs available anymore.
Comment 2 Martin Roskanin 2005-09-15 14:38:28 UTC
please, do not set content type outside awt thread. It is not thread safe
operation. Reassigning.
Comment 3 _ pkuzel 2005-09-15 14:59:46 UTC
I do not understand. 

Component is not visible nor added to AWT hiearchy. In such case it should be
legal to call any method from any thread AFAIK.

I can workaround but at price of blocking AWT for long time.
Comment 4 _ pkuzel 2005-09-15 15:09:24 UTC
Workarounded in CVS:

Checking in DiffMainPanel.java;
/cvs/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/diff/DiffMainPanel.java,v
 <--  DiffMainPanel.java
new revision: 1.13; previous revision: 1.12
done
Checking in Setup.java;
/cvs/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/diff/Setup.java,v
 <--  Setup.java
new revision: 1.9; previous revision: 1.8
done
Checking in DiffStreamSource.java;
/cvs/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/actions/diff/DiffStreamSource.java,v
 <--  DiffStreamSource.java
new revision: 1.8; previous revision: 1.7
done
Comment 5 Martin Roskanin 2005-09-15 15:46:36 UTC
Petr, is the issue fixed?
Comment 6 _ pkuzel 2005-09-15 15:55:22 UTC
Workarounded at CVS side.

Still I think that the assert is incorrect (see above).
Comment 7 Martin Roskanin 2005-09-15 16:23:16 UTC
I am not sure it is legal. Recently, I have added also asserts to
BaseKit.install and BaseKit.deinstall to ensure the operation runs in AWT
thread. We have been already solving several deadlocks, NPEs or other weird
things that happend after incorrect installation outside awt thread. 

Please read the "Note" in:
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html#EDT
It seems that the using of non awt thread before component realization was
revisited.
Comment 8 _ pkuzel 2005-09-15 16:30:16 UTC
Thanks for explanation. I have not been aware of the recent conclusion. 

OK, it's javacvs bug then. It's FIXED.
Comment 9 _ pkuzel 2005-09-15 18:03:56 UTC
Checking in DiffResultsView.java;
/shared/data/ccvs/repository/javacvs/cvsmodule/src/org/netbeans/modules/versioning/system/cvss/ui/history/DiffResultsView.java,v
 <--  DiffResultsView.java
new revision: 1.9; previous revision: 1.8
done