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 119307 - I18N : ClassCastException happens when try to compose Japanese characters into Output window
Summary: I18N : ClassCastException happens when try to compose Japanese characters int...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2007-10-18 07:25 UTC by Masaki Katakai
Modified: 2008-12-22 11:57 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 Masaki Katakai 2007-10-18 07:25:11 UTC
Product Version: NetBeans IDE Dev (Build 200710161200)
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)

At NetBeans 5.5, if we need text input into the application, Input text field will appear in Output window and we can
enter something into it.
On NetBeans 6.0, the input text field is removed (see bug 84375) so we enter something directly on Output window.
But it causes ClassCastException when I type Japanese.

1. Run the small program of bug 84375
2. Turn conversion on Output window
3. Type something

I always get the following ClassCastException.

java.lang.ClassCastException: javax.swing.text.JTextComponent$ComposedTextCaret cannot be cast to
org.netbeans.core.output2.ui.AbstractOutputPane$OCaret
	at org.netbeans.core.output2.ui.AbstractOutputPane.doUpdateCaret(AbstractOutputPane.java:84)
	at org.netbeans.core.output2.OutputDocument.fireDocumentEvent(OutputDocument.java:518)
	at org.netbeans.core.output2.OutputDocument.remove(OutputDocument.java:315)
	at javax.swing.text.JTextComponent.replaceInputMethodText(JTextComponent.java:4691)
	at javax.swing.text.JTextComponent.processInputMethodEvent(JTextComponent.java:4478)
	at java.awt.Component.processEvent(Component.java:5820)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4410)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4240)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 Milos Kleint 2007-10-18 13:49:23 UTC
hopefully fixed. Added additional checks for the instance of Caret to prevent unexpected cast exceptions. Please verify
I don't have the correct setup for testing.

Checking in AbstractOutputPane.java;
/cvs/core/output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java,v  <--  AbstractOutputPane.java
new revision: 1.48; previous revision: 1.47
Comment 2 Masaki Katakai 2007-10-22 14:20:54 UTC
Thank you very much Milos, actually exception does not happen now.

Unfortunately I'm seeing another issue that composing japanese characters is not working properly. It seems that Output
widows keeps the cursor position and it can not be changed during the composing, which is causing the problem. I'll file
new issue.