Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 89610

Summary: [KeyBindings] preference page: IllegalArgumentException using KeySequenceText delete
Product: [Eclipse Project] Platform Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: Tim Mok <timothym>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: 3vanhourigan, benno.baumgartner, channingwalton, daniel_megert, duongn, eclipse, eclipse, ENJ, fuse, igraham, iyers, Karice_McIntyre, markus.kell.r, Michael.Valenta, Mike_Wilson, n.a.edgar, pwebster, remy.suen, Tod_Creasey
Version: 3.1   
Target Milestone: 3.4 M3   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 176235    
Bug Blocks: 174135    
Attachments:
Description Flags
Log file
none
fixes the IAE
none
prevents possible NPE none

Description John Arthorne CLA 2005-03-30 12:14:18 EST
Build: I20050330

I haven't tried reproducing yet, but here is exactly what I did to reproduce the
error:

1) Started a new workspace
2) Went to the Keys preference page, and assigned Source > Sort Members to
"Ctrl+Shift+D", in the context "Editing Java Source"
3) Shutdown and restart

-> The following exception appears in my log several times.  I will attach the
entire log in case it has more interesting details.

java.lang.IllegalArgumentException: All triggers in a trigger sequence must be
an instance of Trigger
	at org.eclipse.jface.bindings.TriggerSequence.<init>(TriggerSequence.java:72)
	at org.eclipse.jface.bindings.keys.KeySequence.<init>(KeySequence.java:191)
	at org.eclipse.jface.bindings.keys.KeySequence.getInstance(KeySequence.java:130)
	at
org.eclipse.jface.bindings.keys.KeySequenceText$KeyTrapListener.handleEvent(KeySequenceText.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:879)
	at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1134)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:875)
	at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1454)
	at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:3338)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3058)
	at org.eclipse.swt.widgets.Text.windowProc(Text.java:1742)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3466)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1625)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2525)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:803)
	at org.eclipse.jface.window.Window.open(Window.java:781)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
	at java.lang.reflect.Method.invoke(Method.java:391)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
	at org.eclipse.core.launcher.Main.run(Main.java:887)
	at org.eclipse.core.launcher.Main.main(Main.java:871)
Comment 1 John Arthorne CLA 2005-03-30 12:14:38 EST
Created attachment 19349 [details]
Log file
Comment 2 John Arthorne CLA 2005-03-30 12:18:18 EST
Unfortunately I can't reproduce with these exact steps.  I must have done
something slightly different, but I can't figure out what...
Comment 3 John Arthorne CLA 2005-03-30 12:20:40 EST
I take it back.  On my second attempt, I hit Alt+F4 to exit, and after shutdown
the same exception was in my log file. So, it seems to be consistently reproducible.
Comment 4 Douglas Pollock CLA 2005-03-30 14:54:31 EST
I'm having problems reproducing this problem.  I think you're going to have to
show it to me.
Comment 5 John Arthorne CLA 2005-03-30 15:56:37 EST
So my steps to reproduce were completely unrelated.  To reproduce, type in a key
binding in the Key Sequence "Name" field on the keys preference page, highlight
the text, and hit the delete key.
Comment 6 Douglas Pollock CLA 2005-03-30 15:57:19 EST
The actual steps are:

1.) Type one key in a KeySequenceText
2.) Select all of the contents using the mouse
3.) Press Backspace
Comment 7 Douglas Pollock CLA 2005-03-30 16:28:31 EST
Arg.  This code is complicated and makes my brain melt.  I'll try to look at
this before 3.1.
Comment 8 Douglas Pollock CLA 2005-04-12 11:37:00 EDT
The preference page re-work has been pulled for the 3.1 plan to work on performance.
Comment 9 Douglas Pollock CLA 2005-05-11 08:50:00 EDT
*** Bug 94264 has been marked as a duplicate of this bug. ***
Comment 10 Douglas Pollock CLA 2005-05-11 08:51:01 EDT
*** Bug 94029 has been marked as a duplicate of this bug. ***
Comment 11 Nick Edgar CLA 2005-05-12 15:00:01 EDT
*** Bug 95020 has been marked as a duplicate of this bug. ***
Comment 12 Douglas Pollock CLA 2005-08-23 11:25:58 EDT
*** Bug 107709 has been marked as a duplicate of this bug. ***
Comment 13 Douglas Pollock CLA 2005-09-21 17:01:36 EDT
*** Bug 110010 has been marked as a duplicate of this bug. ***
Comment 14 Douglas Pollock CLA 2005-10-03 10:06:40 EDT
*** Bug 111280 has been marked as a duplicate of this bug. ***
Comment 15 Douglas Pollock CLA 2006-01-10 13:50:51 EST
*** Bug 123292 has been marked as a duplicate of this bug. ***
Comment 16 Douglas Pollock CLA 2006-01-10 15:25:51 EST
*** Bug 123300 has been marked as a duplicate of this bug. ***
Comment 17 Douglas Pollock CLA 2006-03-15 10:39:18 EST
*** Bug 131898 has been marked as a duplicate of this bug. ***
Comment 18 Michael Van Meekeren CLA 2006-04-21 13:14:35 EDT
Moving Dougs bugs
Comment 19 Paul Webster CLA 2006-05-09 14:04:56 EDT
*** Bug 140869 has been marked as a duplicate of this bug. ***
Comment 20 Paul Webster CLA 2006-09-28 15:14:36 EDT
Is this still a problem in 3.3?

PW
Comment 21 John Arthorne CLA 2006-09-28 15:49:52 EDT
Still reproducible in 3.3 build I20060926  Steps to reproduce are in comment #6.
Comment 22 Channing Walton CLA 2007-02-12 09:31:38 EST
FYI This is happening to me in Eclipse 3.2 M20061122-0800
Comment 23 Paul Webster CLA 2007-03-23 14:50:59 EDT
*** Bug 179095 has been marked as a duplicate of this bug. ***
Comment 24 Markus Keller CLA 2007-05-02 06:13:16 EDT
Still happens in new keys preference page:

!ENTRY org.eclipse.ui 4 0 2007-05-02 12:08:18.796
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalArgumentException: All triggers in a trigger sequence must be an instance of Trigger
        at org.eclipse.jface.bindings.TriggerSequence.<init>(TriggerSequence.java:70)
        at org.eclipse.jface.bindings.keys.KeySequence.<init>(KeySequence.java:200)
        at org.eclipse.jface.bindings.keys.KeySequence.getInstance(KeySequence.java:131)
        at org.eclipse.jface.bindings.keys.KeySequenceText$KeyTrapListener.handleEvent(KeySequenceText.java:127)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:975)
        at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1299)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:971)
        at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1285)
        at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3764)
        at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2013)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:3664)
        at org.eclipse.swt.widgets.Text.windowProc(Text.java:2008)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:4342)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2259)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3282)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
        at org.eclipse.jface.window.Window.open(Window.java:796)
        at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204)
        at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1162)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
Comment 25 Paul Webster CLA 2007-05-09 07:47:25 EDT
*** Bug 186099 has been marked as a duplicate of this bug. ***
Comment 26 Paul Webster CLA 2007-06-26 10:42:46 EDT
*** Bug 138486 has been marked as a duplicate of this bug. ***
Comment 27 Tim Mok CLA 2007-10-03 14:43:32 EDT
Created attachment 79669 [details]
fixes the IAE

It's ok to select the binding and press Backspace or Del to remove the selection or to press another key to overwrite.
Comment 28 Tim Mok CLA 2007-10-12 15:17:35 EDT
Created attachment 80275 [details]
prevents possible NPE
Comment 29 Paul Webster CLA 2007-10-16 13:38:39 EDT
Release to HEAD >20071016

Change the way selected text was deleted from the text widget.

PW
Comment 30 Paul Webster CLA 2007-10-30 10:33:35 EDT
In I20071030-0010
PW
Comment 31 Paul Webster CLA 2008-02-22 15:05:17 EST
*** Bug 220018 has been marked as a duplicate of this bug. ***
Comment 32 Dani Megert CLA 2011-05-11 06:57:22 EDT
This caused a regression, see bug 345372.