Project: JDT
Bug 121060 [quick fix] IllegalStateException after changing type of enum constant
Reported: 2005-12-15 10:25:45 | Status: resolved fixed

Version: 3.2.0 Build id: I20051214-2000 Having: public class P { enum E {ONE} int m(int i) { return E.ONE; } } A quick fix is offered to change the type of ONE to int. Executing the qf results in: java.lang.IllegalStateException: must specify at least one linked position at org.eclipse.jface.text.link.LinkedModeModel.enforceNotEmpty(LinkedModeModel.java:528) at org.eclipse.jface.text.link.LinkedModeModel.install(LinkedModeModel.java:481) at org.eclipse.jface.text.link.LinkedModeModel.forceInstall(LinkedModeModel.java:438) at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal.enterLinkedMode(LinkedCorrectionProposal.java:290) at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal.performChange(LinkedCorrectionProposal.java:239) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:230) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:687) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:633) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1041) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:639) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:415) at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:60) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:923) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:695) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5087) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4829) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:923) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:951) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:947) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1261) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3311) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3212) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3963) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1705) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2903) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1762) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1726) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:397) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java