Project: JDT
Bug 62840 NPE while pasting
Reported: 2004-05-19 00:07:18 | Status: verified fixed

Build: I-20040518-2000 I copied a line from a bugzilla report using Ctrl-C I tried to paste it into my Java file (Ctrl-V) and I kept getting the following NPE: Error May 18, 2004 23:52:48.859 The command for the key you pressed failed java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$OccurrencesFinderJobCanceler. documentAboutToBeChanged(JavaEditor.java:1410) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged (AbstractDocument.java:577) at org.eclipse.jface.text.AbstractDocument.replace (AbstractDocument.java:984) at org.eclipse.jdt.internal.ui.javaeditor.PartiallySynchronizedDocument.replace (PartiallySynchronizedDocument.java:92) at org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange (DefaultDocumentAdapter.java:208) at org.eclipse.swt.custom.StyledText.modifyContent (StyledText.java:5565) at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:6405) at org.eclipse.swt.custom.StyledText.paste(StyledText.java:5602) at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3387) at org.eclipse.jface.text.source.SourceViewer.doOperation (SourceViewer.java:744) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation (ProjectionViewer.java:1044) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation (JavaSourceViewer.java:151) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewe r.doOperation(CompilationUnitEditor.java:198) at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doPasteWithImpo rtsOperation(ClipboardOperationAction.java:406) at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOpera tion(ClipboardOperationAction.java:244) at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run (ClipboardOperationAction.java:224) at org.eclipse.swt.custom.BusyIndicator.showWhile (BusyIndicator.java:69) at org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run (ClipboardOperationAction.java:222) at org.eclipse.jface.action.Action.runWithEvent(Action.java:881) at org.eclipse.ui.commands.ActionHandler.execute (ActionHandler.java:141) at org.eclipse.ui.internal.commands.Command.execute(Command.java:132) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand (WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press (WorkbenchKeyboard.java:886) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent (WorkbenchKeyboard.java:927) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings (WorkbenchKeyboard.java:545) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2 (WorkbenchKeyboard.java:493) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent (WorkbenchKeyboard.java:258) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:712) 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:1724) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1720) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3048) at org.eclipse.swt.widgets.Control.windowProc(Control.java:2951) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3282) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1475) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2380) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1363) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1334) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:253) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:97) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:305) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:256) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:184) at org.eclipse.core.launcher.Main.run(Main.java:637) at org.eclipse.core.launcher.Main.main(Main.java:621)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java