Bug 40381 NPE in LinkedCorrectionProposal
M2 testing java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal$LinkedModeProposal.getDisplayString(LinkedCorrectionProposal.java:205) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComparator.compare(JavaCompletionProposalComparator.java:43) at java.util.Arrays.mergeSort(Arrays.java:1237) at java.util.Arrays.sort(Arrays.java:1227) at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal.getLinkedModeProposals(LinkedCorrectionProposal.java:101) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.enterLinkedMode(CUCorrectionProposal.java:256) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:233) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:328) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:292) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$17(CompletionProposalPopup.java:288) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$4.widgetDefaultSelected(CompletionProposalPopup.java:259) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:96) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2188) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1878) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.run(Unknown Source) at org.eclipse.core.internal.boot.InternalBootLoader.run(Unknown Source) at org.eclipse.core.boot.BootLoader.run(Unknown Source) 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(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LinkedCorrectionProposal.java
}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal#getLinkedRanges()
	 */
	protected GroupDescription[] getLinkedRanges() {
		if (fLinkedPositions != null && !fLinkedPositions.isEmpty()) {
			return (GroupDescription[]) fLinkedPositions.toArray(new GroupDescription[fLinkedPositions.size()]);
		}
		return null;
	}
	
	public GroupDescription markAsSelection(ASTRewrite rewrite, ASTNode node) {
		fSelectionDescription= new GroupDescription("selection"); 
		rewrite.markAsTracked(node, fSelectionDescription);
		return fSelectionDescription;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal#getLinkedModeProposals(java.lang.String)
	 */
	protected ICompletionProposal[] getLinkedModeProposals(String name) {
		if (fLinkProposals == null) {
			return null;
		}
		List proposals= (List) fLinkProposals.get(name);
		if (proposals != null) {
			ICompletionProposal[] res= (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
			if (res.length > 1) {