Bug 48122 NPE in LinkedNamesAssistProposal
I20031203 Sorry, no steps to reproduce but I found several instances of the following in my log: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.LinkedNamesAssistProposal.getSelection(LinkedNamesAssistProposal.java:124) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:375) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:336) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:635) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:603) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:371) 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:967) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:991) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:846) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5321) at org.eclipse.swt.custom.StyledText$8.handleEvent(StyledText.java:5070) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:967) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:991) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:976) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:2237) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1750) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1228) at org.eclipse.swt.widgets.Display.windowProc(Display.java:2317) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Native Method) at org.eclipse.swt.widgets.Display.eventProc(Display.java:710) at org.eclipse.swt.internal.gtk.OS.gtk_main_iteration(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1618) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1486) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1462) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:242) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47) at org.eclipse.core.internal.applicationrunner.ApplicationRunnerActivator$1.run(ApplicationRunnerActivator.java:85) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:87) 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.internal.boot.OSGiBootLoader.basicRun(OSGiBootLoader.java:239) at org.eclipse.core.internal.boot.OSGiBootLoader.run(OSGiBootLoader.java:665) at org.eclipse.core.internal.boot.OSGiBootLoader.run(OSGiBootLoader.java:652) 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.basicRun(Main.java:299) at org.eclipse.core.launcher.Main.run(Main.java:767) at org.eclipse.core.launcher.Main.main(Main.java:601)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CUCorrectionProposal.java
super(name, null, relevance, image);
		fRootEdit= new MultiTextEdit();
		fCompilationUnit= cu;
	}
	
	public CUCorrectionProposal(String name, CompilationUnitChange change, int relevance, Image image) {
		super(name, change, relevance, image);
		fCompilationUnit= change.getCompilationUnit();
	}	
	
	protected CompilationUnitChange createCompilationUnitChange(String name, ICompilationUnit cu, TextEdit rootEdit) throws CoreException {
		CompilationUnitChange change= new CompilationUnitChange(name, cu);
		change.setEdit(rootEdit);
		change.setSave(false);
		setChange(change);
		return change;
	}
	/*
	 * @see ChangeCorrectionProposal#getChange()
	 */
	protected Change getChange() throws CoreException {
		Change change= super.getChange();
		if (change == null) {
			return createCompilationUnitChange(getDisplayString(), fCompilationUnit, fRootEdit);
		}
		return change;
	}
	
	protected final void addEdits(CompilationUnitChange change) throws CoreException {
	}