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

Bug 123783

Summary: [typing] Hyperlink presenter must react to document changes
Product: [Eclipse Project] Platform Reporter: Jan Ploski <jpljpl>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P2 CC: n.a.edgar
Version: 3.1.1   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jan Ploski CLA 2006-01-13 11:35:27 EST
There seems to be an undesired interference between "Delete Next Word" and
hyperlink highlighting in rare circumstances (easy to reproduce, though):

Steps to reproduce:

1. Create a new Java class.
2. Move caret to the very end of file
3. Enter "// String", so that "g" is the last character of the file
4. Select the "r" in "String"
5. Now move the mouse pointer over the word while holding CTRL to activate
   Java hyperlink highlighting
6. While still holding CTRL, press DEL

In addition to "r" being deleted, an error dialog pops up and the following
exception is logged:

"Delete Next Word" did not complete normally.  Please see the log for more information.

java.lang.IllegalArgumentException: Index out of bounds
at org.eclipse.swt.SWT.error(SWT.java:2926)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at org.eclipse.swt.SWT.error(SWT.java:2836)
at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:6415)
at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4215)
at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4294)
at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:573)
at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:562)
at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:558)
at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:224)
at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2377)
at org.eclipse.jface.text.TextViewer$VisibleDocumentListener.documentChanged(TextViewer.java:326)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:729)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:692)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:677)
at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:754)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1112)
at org.eclipse.jdt.internal.ui.javaeditor.PartiallySynchronizedDocument.replace(PartiallySynchronizedDocument.java:111)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1119)
at org.eclipse.jdt.internal.ui.javaeditor.PartiallySynchronizedDocument.replace(PartiallySynchronizedDocument.java:102)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$DeleteNextSubWordAction.setCaretPosition(JavaEditor.java:1006)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$NextSubWordAction.run(JavaEditor.java:919)
at org.eclipse.ui.texteditor.TextNavigationAction.runWithEvent(TextNavigationAction.java:106)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:108)
at org.eclipse.core.commands.Command.execute(Command.java:311)
at org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:459)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:781)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:828)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:550)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:493)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:117)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1252)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1020)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1045)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1030)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:621)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1964)
at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:560)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1365)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3442)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:4777)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1067)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1158)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2570)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
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.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Dani Megert CLA 2006-04-04 05:20:36 EDT
*** Bug 85019 has been marked as a duplicate of this bug. ***
Comment 2 Dani Megert CLA 2006-04-04 05:24:00 EDT
Fixed in HEAD.
Available in builds > N20060404-0010.
Comment 3 Benno Baumgartner CLA 2006-04-26 11:26:50 EDT
verified in 20060426