Project: JDT
Bug 85327 NPE in OverrideCompletionProposal.updateReplacementString
Reported: 2005-02-15 16:09:19 | Status: resolved fixed

eclipse.buildId=I200411300800 java.version=1.4.2_03 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en Framework arguments: -showlocation Command-line arguments: -os win32 -ws win32 -arch x86 -clean -showlocation - nl en I have the code below. I placed the cursor in the spot indicated in the code and hit Ctrl+Space. I used the arrow keys to select "dragStart" and pressed return. Nothing was insterted and the error below was in the log. public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout(new RowLayout()); Label label1 = new Label(shell, SWT.BORDER); Label label2 = new Label(shell, SWT.BORDER); DragSource dragSource = new DragSource(label1, DND.DROP_COPY); dragSource.setTransfer(new Transfer[] {TextTransfer.getInstance(), FileTransfer.getInstance()}); dragSource.addDragListener(new DragSourceAdapter() { // !!! PUT CURSOR BELOW THIS LINE }); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.java.OverrideCompletionProposal.updateReplacem entString(OverrideCompletionProposal.java:98) at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposal.apply (JavaTypeCompletionProposal.java:114) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal.apply (JavaCompletionProposal.java:568) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal (CompletionProposalPopup.java:420) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWith Mask(CompletionProposalPopup.java:367) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey (CompletionProposalPopup.java:750) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKe y(ContentAssistant.java:622) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey (TextViewer.java:414) at org.eclipse.swt.custom.StyledTextListener.handleEvent (StyledTextListener.java:55) 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.notifyListeners(Widget.java:659) at org.eclipse.swt.custom.StyledText.handleKeyDown (StyledText.java:5039) at org.eclipse.swt.custom.StyledText$7.handleEvent (StyledText.java:4786) 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.Widget.sendKeyEvent(Widget.java:875) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1181) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3121) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3024) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3481) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1619) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2540) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1612) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1578) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:293) 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:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:333) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:150) 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:324) 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)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ResultCollector.java