Bug 121900 - [call hierarchy] document positions not updated for call locations
Summary: [call hierarchy] document positions not updated for call locations
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-22 12:00 EST by Alex Chapiro CLA
Modified: 2023-11-28 13:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Chapiro CLA 2005-12-22 12:00:38 EST
Clicked to the line in Call Hierarchy view and got an exception:

java.lang.ArrayIndexOutOfBoundsException
at org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.getText(DocumentAdapter.java:317)
at org.eclipse.jdt.internal.corext.callhierarchy.CallLocation.initCallTextAndLineNumber(CallLocation.java:91)
at org.eclipse.jdt.internal.corext.callhierarchy.CallLocation.getLineNumber(CallLocation.java:71)
at org.eclipse.jdt.internal.ui.callhierarchy.LocationLabelProvider.getColumnText(LocationLabelProvider.java:93)
at org.eclipse.jface.viewers.TableViewer.doUpdateItem(TableViewer.java:473)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:434)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:785)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:1763)
at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:859)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:796)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:785)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:746)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:249)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417)
at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.updateLocationsView(CallHierarchyViewPart.java:866)
at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.methodSelectionChanged(CallHierarchyViewPart.java:601)
at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewPart.selectionChanged(CallHierarchyViewPart.java:586)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:785)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1784)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1027)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1053)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:210)
at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:205)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:365)
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.Display.runDeferredEvents(Display.java:3285)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2905)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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)

I don't mean that I get it always :-) Anyway, exception is exception.
Comment 1 Dani Megert CLA 2005-12-23 05:21:10 EST
A bit more info would be welcome (build id, steps, etc.) next time ;-)

CallLocation ignores the fact that documents can be edited: it stores start and end without updating them when the document changes. The CallLocation should either re-calculate the start and end offset or store the info in a document position which gets automatically adjusted. If you decide to use a position then don't forget to check whether it has been deleted.
Comment 2 Tobias Widmer CLA 2005-12-23 05:32:13 EST
Markus, can you have a look?
Comment 3 Alex Chapiro CLA 2005-12-23 08:40:15 EST
I used official 3.2M4 build.
I'm sorry but I cannot recollect any specific steps beside those I've already reported. I guess that I wanted to check method signature and before doing that decided to check all method call occurences. Exception was raised for the last one in the list. I do not remember that I edited text between getting of the call list and the error.  
It also clear to me that calling tree is essencially a static data and if one wants to see the correct information, she probably has to refresh it before. However even in case of unsynchronized data, raising of the exception  is not the best possible  system reaction, I suppose :-)
Comment 4 Markus Keller CLA 2006-01-03 12:04:38 EST
Released a workaround to HEAD to not throw an exception. The real solution should try to reuse code from search (PositionTracker). See also bug 83234 for problems with java model changes.
Comment 5 Markus Keller CLA 2008-04-14 05:23:51 EDT
(In reply to comment #4)
Bug 226470 comment 4 would need the same infrastructure for updating external annotations.
Comment 6 Eclipse Genie CLA 2019-12-13 18:41:05 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Dani Megert CLA 2019-12-17 04:38:12 EST
Nothing has been done yet.
Comment 8 Eclipse Genie CLA 2021-12-07 12:05:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 9 Eclipse Genie CLA 2023-11-28 13:48:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.