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 6258 - [i18n] UNDO shows intermediate characters of Japanese
Summary: [i18n] UNDO shows intermediate characters of Japanese
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 10676 19313 (view as bug list)
Depends on:
Blocks:
 
Reported: 2000-04-13 03:14 UTC by Jiri Skrivanek
Modified: 2007-11-05 13:44 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
diff in -c format (2.04 KB, patch)
2003-01-10 13:07 UTC, Jan Kovar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2000-04-13 03:14:57 UTC
On Editor, when try to continue UNDO (Ctrl-Z) to delete Japanese characters, some intermediate character is
shown in the editor.
How to reproduce:

1)  Open a New text file in the editor
2)  Switch to KANJI mode
3)  Type  k a k a k a    and Enter
     Now you see KA KA KA  (3 Japanese texts)
4)  Hit Ctrl-Z (UNDO) then you will see the inputed characters are deleted in a strange way..
    0.    KAKAKA   (before Ctrl-Z)
    1.                     (1st hit of Ctrl-Z .. nothing on the line)
    2.    KAKAKA   (2nd hit)
    3.                     (3rd ..)
    4.    KAKAk       (4th hit .. here a fragment `k` is shown )
    5.
    6.    KAKA
    7.
    8.    KAk
    9.

   10.    KA
   11.
   12.    k
   13.

For your information, Backspace key and Delete key can delete Japanese text one by one.
Comment 1 Marek Grummich 2000-07-25 09:07:59 UTC
Priority is changed to P4 (normal).
Comment 2 Jan Lahoda 2001-01-24 15:31:59 UTC
Only changed version to Development.
Comment 3 Jan Chalupa 2001-03-12 10:35:46 UTC
Version: 'Dev' -> 3.2
Comment 4 Jan Chalupa 2001-05-05 21:53:47 UTC
Target milestone -> 3.3
Comment 5 Jan Lahoda 2001-10-29 10:48:53 UTC
*** Issue 10676 has been marked as a duplicate of this issue. ***
Comment 6 Jan Chalupa 2001-11-27 12:26:48 UTC
Target milestone -> 3.3.1.
Comment 7 Hiroshi Nakatsubo 2002-01-11 06:30:30 UTC
*** Issue 19313 has been marked as a duplicate of this issue. ***
Comment 8 Ken Frank 2002-03-08 18:01:28 UTC
making P3 since  user in Japanese locale should be able to operate in
editor
the same as user in English or European locales.
ken.frank@sun.com
03/08/2002
Comment 9 Jan Kovar 2002-06-27 13:39:55 UTC
I was not able to reproduce it in the newest builds.
What is happening to me is that after I enter kakaka and 
enter the Ctrl-Z removes whole word. I think this is 
correct way to deal with it no?

Could any one of you try to reproduce it in the latest 
build and write feedback here?
I would recommend to close this issue as 'worksforme'. What
is your oppinion, Mila?
Comment 10 Jiri Skrivanek 2002-06-28 09:15:36 UTC
Honzo F., could you ask Japanese guys to check if it works or not?
Comment 11 Honza Firich 2002-07-03 15:16:33 UTC
I have verified it and asked Japanese people for checking 
and here is the result:
Please hit Ctrl-Z again and again.
        Input Japanese "KAKAKA"
        Hit Ctrl-Z
        Hit Ctrl-Z
        Hit Ctrl-Z....

When first hitting, Japanese "KAKAKA" is erased. (correct 
behavior).
When second and third hitting, Japanese "KAKAKA" comes 
back, and it's corrupted, what is not correct.

Thus the fix failed.
Comment 12 Marek Grummich 2002-07-22 10:02:07 UTC
Set target milestone to TBD
Comment 13 Marek Grummich 2002-07-22 10:08:06 UTC
Set target milestone to TBD
Comment 14 Jan Kovar 2003-01-10 13:05:17 UTC
I think the problem is caused by the fact that when 
creating the japanese word using input method all 
intermediate results are stored as undoable edits.
After that the last (correct) edit is stored aswell, but 
the undo queue is already full of those bad edits so when
hitting UNDO more then once...

So the fix is to disable firing undoable edit events 
during japanese word composition.

Diff of proposed fix below.
Comment 15 Jan Kovar 2003-01-10 13:07:01 UTC
Created attachment 8525 [details]
diff in -c format
Comment 16 Miloslav Metelka 2003-02-12 12:31:24 UTC
Integrated into main trunk:

Checking in libsrc/org/netbeans/editor/BaseDocument.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v  <-- 
BaseDocument.java
new revision: 1.89; previous revision: 1.88
done
Comment 17 Honza Firich 2003-02-13 14:29:36 UTC
Verified this bug on build:

NetBeans dev build
------------------
Number:   200302130100
Branch:   trunk

Checked it using JDK 1.4 and worked fine on Windows 
2000 with Japanese environment.
Comment 18 gautham mudra 2003-04-03 23:15:12 UTC
Verified on  Sierra RC5_a Build  with the patches.

OS:win2000
jdk:1.4.0_02
Comment 19 Quality Engineering 2003-07-02 17:18:40 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.
Comment 20 gautham mudra 2003-08-15 18:11:40 UTC
could not verify fix on sierra update1 with patch 113638-4.
Configuration:
Build:Sierra Update1 020923
JDK:1.4.0_03
Locale:ja_JP

Comment 21 cahrens 2003-12-03 15:01:48 UTC
I just tried this fix as well and it did not work.  It was ok if I 
only did UNDO and REDO once the composed text was accepted (via 
Enter), but if I did it while composing the text I would soon start 
getting exceptions.  It seems that the length of the document would 
get out of whack.
Comment 22 cahrens 2003-12-03 16:34:04 UTC
This is an example of the JavaExceptions that I see (see note 
above).  This is from NetBeans 3.5.1.

javax.swing.undo.CannotUndoException
	at org.netbeans.editor.BaseDocumentEvent.undo
(BaseDocumentEvent.java:211)
	at org.netbeans.editor.GuardedDocumentEvent.undo
(GuardedDocumentEvent.java:41)
	at javax.swing.undo.CompoundEdit.undo(CompoundEdit.java:46)
	at org.netbeans.editor.BaseDocument$AtomicCompoundEdit.undo
(BaseDocument.java:1302)
	at javax.swing.undo.UndoManager.undoTo(UndoManager.java:210)
	at javax.swing.undo.UndoManager.undo(UndoManager.java:275)
	at org.openide.actions.UndoAction.performAction
(UndoAction.java:120)
	at 
org.openide.util.actions.CallableSystemAction.actionPerformed
(CallableSystemAction.java:69)
	at 
org.netbeans.modules.editor.NbEditorKit$NbUndoAction.actionPerformed
(NbEditorKit.java:332)
	at org.netbeans.editor.BaseAction.actionPerformed
(BaseAction.java:137)
	at javax.swing.SwingUtilities.notifyAction
(SwingUtilities.java:1530)
	at javax.swing.JComponent.processKeyBinding
(JComponent.java:2438)
	at javax.swing.JComponent.processKeyBindings
(JComponent.java:2473)
	at javax.swing.JComponent.processKeyEvent
(JComponent.java:2401)
	at java.awt.Component.processEvent(Component.java:4909)
	at java.awt.Container.processEvent(Container.java:1569)
	at java.awt.Component.dispatchEventImpl(Component.java:3615)
	at java.awt.Container.dispatchEventImpl(Container.java:1627)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.KeyboardFocusManager.redispatchEvent
(KeyboardFocusManager.java:1713)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent
(DefaultKeyboardFocusManager.java:627)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent
(DefaultKeyboardFocusManager.java:831)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions
(DefaultKeyboardFocusManager.java:741)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent
(DefaultKeyboardFocusManager.java:592)
	at java.awt.Component.dispatchEventImpl(Component.java:3506)
	at java.awt.Container.dispatchEventImpl(Container.java:1627)
	at java.awt.Window.dispatchEventImpl(Window.java:1606)
	at java.awt.Component.dispatchEvent(Component.java:3477)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:145)
	at java.awt.EventDispatchThread.pumpEvents
(EventDispatchThread.java:137)
	at java.awt.EventDispatchThread.run
(EventDispatchThread.java:100)
Comment 23 Miloslav Metelka 2004-01-23 12:36:59 UTC
It seems that there is some problem related to skipping of the
document events for the text composing. We need to check whether
isLastModifyUndoEdit() in canUndo() works OK in this situation. I hope
that we will be able to fix this into 3.6.
Comment 24 Miloslav Metelka 2004-09-06 16:57:04 UTC
I've checked again on Solaris with Japanese with current builds on
jdk1.4.2_05 and it works fine. I've tried both undo and redo both when
I was in the middle of the input method or when I've finished it. I
guess the previous problems could be caused by the asynchronous
implementation of UndoRedo which is now synchronous again (please see
issue 42005 for details).
Therefore closing as fixed. Please reopen if the problems persist.
Comment 25 Jiri Skrivanek 2004-09-07 08:08:35 UTC
Could someone who faced the problems verify this issue? Thanks.
Comment 26 Jiri Skrivanek 2004-12-02 12:39:46 UTC
Verified.