Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 131884 - [Contributions] NPE in org.eclipse.debug.internal.ui.actions.CopyToClipboardActionDelegate.initialize(CopyToClipboardActionDelegate.java:43)
Summary: [Contributions] NPE in org.eclipse.debug.internal.ui.actions.CopyToClipboardA...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P1 blocker (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 132487 132826 133316 133317 133493 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-15 04:33 EST by Dani Megert CLA
Modified: 2006-03-29 11:22 EST (History)
11 users (show)

See Also:


Attachments
Patch to LegacyActionPersistence (31.49 KB, application/octet-stream)
2006-03-28 14:51 EST, Douglas Pollock CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-03-15 04:33:17 EST
Found in .log. Sorry no steps.

!SESSION 2006-03-15 09:56:14.864 -----------------------------------------------
eclipse.buildId=I20060314-1200
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation
Command-line arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation -data c:\eclipse\workspaces\Development_3_2\plugins

!ENTRY org.eclipse.ui 4 4 2006-03-15 10:28:54.592
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2006-03-15 10:28:54.592
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at org.eclipse.debug.internal.ui.actions.CopyToClipboardActionDelegate.initialize(CopyToClipboardActionDelegate.java:43)
	at org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate.selectionChanged(AbstractDebugActionDelegate.java:290)
	at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:249)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:460)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:924)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958)
	at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1557)
	at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:3564)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3272)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4017)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1878)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2958)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1909)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1873)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:418)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:107)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
	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.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Dani Megert CLA 2006-03-15 04:44:25 EST
The NPE happens when using copy (Ctrl+C) in a standard text editor and hence copy/paste no longer works in a text editor.

NOTE: It does not always happen but when it happens it is pretty severe since it breaky the copy command.
Comment 2 Darin Wright CLA 2006-03-15 08:45:09 EST
I can't make this happen. It looks like the delegate was called with selectionChanged before it was initialized for its view (i.e. IViewActionDelegate.init(IViewPart)). Dani, do you have steps to reproduce? It might be a workbench issue.
Comment 3 Dani Megert CLA 2006-03-15 09:31:30 EST
Once I was in that state, simply hitting Ctrl+C did the trick. Can't reproduce right now. Indee strange is that your code got triggered while in the Text Editor. This might well be command or handler bug in Platform UI.

However, you might want to protect your code against the NPE.
Comment 4 Darin Wright CLA 2006-03-15 10:17:01 EST
Moving to Workbench for comment. I don't want to add null checks in the code when there is no reason (makes maintenance difficult - no one knows why the null check is there).
Comment 5 Tod Creasey CLA 2006-03-15 10:37:21 EST
Note we also see this in the test suites sometimes too
Comment 6 Douglas Pollock CLA 2006-03-15 15:11:20 EST
I've committed a small patch which should handle this case, if I understand it correctly.  Please re-open this bug if you see it in I20060321-0800 or later.  (The patch was applied to ActionDelegateHandlerProxy)
Comment 7 Tod Creasey CLA 2006-03-16 07:23:09 EST
This happened again on the N20060316 nightly build

http://fullmoon.ottawa.ibm.com/eclipse/downloads/drops/I20060315-1200/testresults/html/org.eclipse.ui.tests_linux.gtk.x86.html
Comment 8 Tod Creasey CLA 2006-03-16 07:24:53 EST
Sorry that is the 0315 1200 integration build
Comment 9 Boris Bokowski CLA 2006-03-16 08:46:48 EST
John, this might be what happened yesterday when CTRL-C stopped working. Could you check your log to see if it was the same NPE?
Comment 10 Douglas Pollock CLA 2006-03-16 09:00:49 EST
So it didn't happen in the nightly build?  Closing again....
Comment 11 John Arthorne CLA 2006-03-16 09:38:13 EST
Boris: yes, this is the same error I got, using I20060314-1200.
Comment 12 Markus Keller CLA 2006-03-20 05:47:21 EST
*** Bug 132487 has been marked as a duplicate of this bug. ***
Comment 13 Olivier Thomann CLA 2006-03-22 11:07:53 EST
Got it again today using :
eclipse.buildId=I20060321-1210
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA
Framework arguments:  -showlocation
Command-line arguments:  -os win32 -ws win32 -arch x86 -debug -consolelog -showlocation

java.lang.NullPointerException
at org.eclipse.debug.internal.ui.actions.CopyToClipboardActionDelegate.initialize(CopyToClipboardActionDelegate.java:43)
at org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate.selectionChanged(AbstractDebugActionDelegate.java:290)
at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:249)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:460)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:924)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1272)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4023)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1879)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2964)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1909)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1873)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:418)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:107)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
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.core.launcher.Main.invokeFramework(Main.java:338)
at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 14 Markus Keller CLA 2006-03-22 12:24:49 EST
*** Bug 132826 has been marked as a duplicate of this bug. ***
Comment 15 Dani Megert CLA 2006-03-23 03:48:10 EST
Sorry but this is critical. Just started I20060322-1335 and Copy in the Java editor simply resulted in the NPE - each time, in each editor.

Even after restarting I got the same NPEs.
Comment 16 Darin Wright CLA 2006-03-24 13:10:35 EST
*** Bug 132856 has been marked as a duplicate of this bug. ***
Comment 17 Darin Wright CLA 2006-03-27 09:12:57 EST
*** Bug 133316 has been marked as a duplicate of this bug. ***
Comment 18 Darin Wright CLA 2006-03-27 09:16:25 EST
*** Bug 133317 has been marked as a duplicate of this bug. ***
Comment 19 Darin Wright CLA 2006-03-28 09:00:27 EST
*** Bug 133493 has been marked as a duplicate of this bug. ***
Comment 20 Darin Wright CLA 2006-03-28 09:01:50 EST
*** Bug 133512 has been marked as a duplicate of this bug. ***
Comment 21 Olivier Thomann CLA 2006-03-28 09:14:13 EST
Set to blocker. This is a must fix for M6. When this happens, the UI is completely unusable.
Comment 22 Dani Megert CLA 2006-03-28 09:28:35 EST
I agree with Olivier.
Comment 23 Douglas Pollock CLA 2006-03-28 11:02:09 EST
Has anyone seen this on any platform other than Windows XP?
Comment 24 Paul Webster CLA 2006-03-28 11:07:04 EST
I haven't encountered it in my linux workspaces.

PW
Comment 25 Olivier Thomann CLA 2006-03-28 11:10:47 EST
In general I have many problems with the key bindings. I lose the Ctrl key inside the java editor. Ctrl + S, Ctrl + C, Ctrl + V etc don't work anymore. Delete also stopped working.
I had to close Eclipse and restart to get them back. Nothing in the log.
I am using Windows XP and I didn't get it on other platform like Linux GTK.
Comment 26 Douglas Pollock CLA 2006-03-28 11:29:47 EST
There was a separate bug which affected several key bindings.  This bug only deals with people seeing the exception in comment #0.  If your bug has been marked as a dupe and you are not seeing that exception, please re-open your original bug.

Hands up: How many are seeing the exception in comment #0?  How many are seeing it on a platform on something other than Windows XP?
Comment 27 Dani Megert CLA 2006-03-28 11:36:09 EST
I see it quite often. WindowsXP.
Comment 28 Martin Aeschlimann CLA 2006-03-28 11:45:28 EST
I get it often too, including build I20060328-0010. (WinXP)
Comment 29 John Arthorne CLA 2006-03-28 11:45:54 EST
I have had the NPE in comment #0 on Windows 2000 only. I have not seen it myself since I20060314-1200.
Comment 30 Markus Keller CLA 2006-03-28 12:07:27 EST
I've had the exception in I20060314-1200, but not in build I20060322 or later. I'm working under WinXP only.
Comment 31 Douglas Pollock CLA 2006-03-28 12:10:04 EST
Okay, let's try to figure out what is special about Dani and Martin.  Is there something peculiar about your configuration?  Do you guys tend to use multiple workbench windows?
Comment 32 Martin Aeschlimann CLA 2006-03-28 12:15:10 EST
No, I'm using a single window. I don't think I have anything special in my install. 
Comment 33 Dani Megert CLA 2006-03-28 12:16:15 EST
Yes. I normally use 3 in parallel. They are already present when starting my workbench. In todays test pass I also had it in a single workbench window setup using I20060328-0010.
Comment 34 Johan Compagner CLA 2006-03-28 12:54:16 EST
i can reproduce it easily as far as i can see now.

Just start eclipse.
Kill it (i have eclipse started as java instead of javaw so i get console window where i do CTRL-C)

So eclipse is not cleanly shutdown.
Then i restart again (eclipse is going to build the complete workspace and so on)
Then press ctrl-c in a java editor. Doesn't work.
I have to restart eclipse once to get it "clean" again.
Comment 35 Douglas Pollock CLA 2006-03-28 14:51:50 EST
Created attachment 37129 [details]
Patch to LegacyActionPersistence

Can people please try this modified LegacyActionPersistence, and let me know if it works?  The file should appear in the workbench plug-in:

<org.eclipse.ui.workbench>/org/eclipse/ui/internal/menus/LegacyActionPersistence.class
Comment 36 Dani Megert CLA 2006-03-28 15:09:28 EST
Doug, could you attach the workbench.jar? That would make it much easier for us to test it than loading and patching the stuff ourselves.
Comment 37 Douglas Pollock CLA 2006-03-28 15:23:53 EST
(In reply to comment #36)
> Doug, could you attach the workbench.jar? That would make it much easier for
> us to test it than loading and patching the stuff ourselves.

No, I cannot.  The JAR file is 3MB.

1.) Download the JAR file to /tmp
2.) Copy your workbench JAR file to /tmp
3.) mkdir -p org/eclipse/ui/internal/menus
4.) zip -f org.eclipse.ui.workbench_something.jar org/eclipse/ui/internal/menus/LegacyActionPersistence
5.) Copy your workbench JAR file back to your Eclipse install
Comment 38 Dani Megert CLA 2006-03-29 08:17:12 EST
Doug, so far I don't see the NPE anymore but it is hard to confirm 100% since I didn't have a test case to trigger it before.
Comment 39 Jerome Lanneluc CLA 2006-03-29 09:33:02 EST
I have been using I20060329-0010 for several hours now, and I've not seen the NPE.
Comment 40 Douglas Pollock CLA 2006-03-29 11:22:15 EST
The patched LegacyActionPersistence appeared in I20060329-0010.  Marking as FIXED.  Please re-open this bug if anyone sees this bug in that build or later.