Bug 43109 AssertionFailedException in CUCorrectionProposal
200309100800 no steps, found this in the log: !MESSAGE Unhandled exception caught in event loop. Unhandled exception caught in event loop. Reason: !ENTRY org.eclipse.ui 4 0 Sep 15, 2003 17:19:24.461 !MESSAGE assertion failed; !STACK 0 org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:136) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:121) at org.eclipse.jdt.internal.corext.refactoring.changes.TextChange.getNewTextRange(TextChange.java:416) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.enterLinkedMode(CUCorrectionProposal.java:25 5) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:234) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:328) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.j ava:292) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:585) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:601) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:368) 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:847) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:871) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:856) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:664) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5281) at org.eclipse.swt.custom.StyledText$8.handleEvent(StyledText.java:5030) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:871) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:856) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1688) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1684) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3014) at org.eclipse.swt.widgets.Control.windowProc(Control.java:2893) at org.eclipse.swt.widgets.Display.windowProc(Display.java:2713) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1343) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1876) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2037) at org.eclipse.ui.internal.Workbench.run(Workbench.java:2020) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:295) at org.eclipse.core.launcher.Main.run(Main.java:751) at org.eclipse.core.launcher.Main.main(Main.java:587)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/CUCorrectionProposal.java
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.jdt.internal.corext.refactoring.base.Change;
import org.eclipse.jdt.internal.corext.refactoring.changes.CompilationUnitChange;
import org.eclipse.jdt.internal.corext.textmanipulation.GroupDescription;
import org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer;
import org.eclipse.jdt.internal.corext.textmanipulation.TextRegion;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.corext.util.Resources;
import org.eclipse.jdt.internal.corext.util.Strings;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.compare.JavaTokenComparator;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager;
import org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI;
public class CUCorrectionProposal extends ChangeCorrectionProposal  {
	private ICompilationUnit fCompilationUnit;
	private TextEdit fRootEdit;
	
	public CUCorrectionProposal(String name, ICompilationUnit cu, int relevance) {