Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284242

Summary: [quick assist] Exception on Quickfix "assign parameter to new field"
Product: [Eclipse Project] JDT Reporter: Ulli Hafner <Knut.Friedhelm>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ulli Hafner CLA 2009-07-22 06:36:19 EDT
I tried to apply the quick fix "assign paramter to new field" in the following constructor:

    /**
     * Creates a new instance of <code>SorterModel</code>.
     * 
     * @param model
     *            the corresponding table model
     */
    public SorterModel(TableColumnModel model[Cursor and CTRL+1]) {
        super();

        sorting = new ArrayList<SortableProperty>();
        publicSortingProperties = Collections.unmodifiableList(sorting);
    }

Eclipse inserted the new field, but before inserting the field assignment the following exception is thrown. 
I can't reproduce this problem, but this seems to be a typical race condition. (BTW, maybe that is related: a race condition also occurs very frequently for me in the automatic cleanup on save (save participant) where the final modifiers sometimes are inserted at the wrong position.)


-- Error Details --
Date: Wed Jul 22 12:30:34 CEST 2009
Message: Internal Error
Severity: Error
Product: Eclipse 1.2.0.20090618-0904 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.jdt.ui
Session Data:
eclipse.buildId=I20090611-1540
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product -data C:\Work\Workspaces\Trunk


Exception Stack Trace:
org.eclipse.core.runtime.CoreException: First position: '' at 1562, this position: 'private' at 1568
at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.performChange(CUCorrectionProposal.java:343)
at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.apply(CUCorrectionProposal.java:301)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:931)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:877)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1304)
at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:806)
at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:489)
at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:62)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:770)
at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5837)
at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5541)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053)
at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4589)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2409)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: org.eclipse.jface.text.BadLocationException: First position: '' at 1562, this position: 'private' at 1568
at org.eclipse.jface.text.link.LinkedPositionGroup.enforceEqualContent(LinkedPositionGroup.java:132)
at org.eclipse.jface.text.link.LinkedPositionGroup.addPosition(LinkedPositionGroup.java:113)
at org.eclipse.jdt.internal.ui.viewsupport.LinkedProposalModelPresenter.enterLinkedMode(LinkedProposalModelPresenter.java:94)
at org.eclipse.jdt.internal.ui.text.correction.proposals.CUCorrectionProposal.performChange(CUCorrectionProposal.java:332)
... 50 more
Comment 1 Markus Keller CLA 2009-07-27 10:21:16 EDT

*** This bug has been marked as a duplicate of bug 195834 ***