Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 74948 - Exception when cutting a method
Summary: Exception when cutting a method
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-24 10:35 EDT by Michael Valenta CLA
Modified: 2004-11-03 05:21 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2004-09-24 10:35:17 EDT
I got the following exception when a was cutting a method from the Java text 
editor:

!SESSION Sep 24, 2004 10:23:13.619 --------------------------------------------
-
eclipse.buildId=I200409231635
java.fullversion=J2RE 1.4.2 IBM J9 2.2 Windows XP x86-32 j9n142-20040908 (JIT 
enabled)
J9VM - 20040907_1026_lHdSMR
JIT  - r7_level20040905_1800
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA

!ENTRY org.eclipse.ui 4 4 Sep 24, 2004 10:23:13.619
!MESSAGE The command for the key you pressed failed

!ENTRY org.eclipse.ui 4 0 Sep 24, 2004 10:23:13.634
!MESSAGE null argument;
!STACK 0
org.eclipse.jface.text.Assert$AssertionFailedException: null argument;
	at org.eclipse.jface.text.Assert.isNotNull(Assert.java:146)
	at org.eclipse.jface.text.Assert.isNotNull(Assert.java:122)
	at org.eclipse.text.edits.ReplaceEdit.<init>(ReplaceEdit.java:36)
	at org.eclipse.jface.text.link.LinkedPositionGroup.handleEvent
(LinkedPositionGroup.java:244)
	at 
org.eclipse.jface.text.link.LinkedModeModel$DocumentListener.documentChanged
(LinkedModeModel.java:216)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2
(AbstractDocument.java:682)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged
(AbstractDocument.java:645)
	at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged
(AbstractDocument.java:630)
	at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged
(AbstractDocument.java:707)
	at org.eclipse.jface.text.AbstractDocument.replace
(AbstractDocument.java:998)
	at 
org.eclipse.jdt.internal.ui.javaeditor.PartiallySynchronizedDocument.replace
(PartiallySynchronizedDocument.java:92)
	at 
org.eclipse.jface.text.source.projection.ProjectionViewer.deleteTextRange
(ProjectionViewer.java:1491)
	at 
org.eclipse.jface.text.source.projection.ProjectionViewer.copyToClipboard
(ProjectionViewer.java:1482)
	at 
org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation
(ProjectionViewer.java:1353)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation
(JavaSourceViewer.java:152)
	at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewe
r.doOperation(CompilationUnitEditor.java:199)
	at 
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doCutCopyWithIm
portsOperation(ClipboardOperationAction.java:304)
	at 
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOpera
tion(ClipboardOperationAction.java:256)
	at 
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run
(ClipboardOperationAction.java:225)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:69)
	at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run
(ClipboardOperationAction.java:223)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:988)
	at org.eclipse.ui.commands.ActionHandler.execute
(ActionHandler.java:188)
	at org.eclipse.ui.internal.commands.Command.execute(Command.java:130)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand
(WorkbenchKeyboard.java:463)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press
(WorkbenchKeyboard.java:956)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent
(WorkbenchKeyboard.java:997)
	at 
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings
(WorkbenchKeyboard.java:541)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2
(WorkbenchKeyboard.java:488)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent
(WorkbenchKeyboard.java:241)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:748)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:795)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:820)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:805)
	at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1736)
	at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1732)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3073)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:2975)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3349)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1479)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2440)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1443)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1414)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:271)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:102)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:335)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:129)
	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.basicRun(Main.java:185)
	at org.eclipse.core.launcher.Main.run(Main.java:704)
	at org.eclipse.core.launcher.Main.main(Main.java:688)
Comment 1 Tom Hofmann CLA 2004-09-24 11:12:07 EDT
can easily be reproduced with this code:

String m() {
  String string= null;
  return string;
}

- put caret into 'string'
- invoke "local rename" quick assist
- press Ctrl+X to cut an entire name

LinkedPositionGroup.handleEvent must use an empty String for the Replace if the
document event specifies a null text.

fixed > 20040924
Comment 2 Markus Keller CLA 2004-11-03 05:21:19 EST
Verified in 200411022000.
Filed bug 77575 for problem with undo grouping after cut.