Bug 83234 - [call hierarchy] CallHierarchy fails after change in Java Model
Summary: [call hierarchy] CallHierarchy fails after change in Java Model
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 66520 102124 162196 268801 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-19 15:03 EST by Michael Fraenkel CLA
Modified: 2022-09-30 17:44 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Fraenkel CLA 2005-01-19 15:03:05 EST
eclipse.buildId=I20050118-1015

1. Import a binary plugin with content like jdt.ui
2. Open SurroundWithTryCatchAnalyzer
3. Perform a call hierarchy on getExceptions
4. Delete the jdt.ui project (although my original scenario did an extract from CVS)
5. Select a member in the call hierarchy

Notice the .log filling up with:
Java Model Exception: Java Model Status [org.eclipse.jdt.ui does not exist]
        at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:527)
        at
org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:336)
        at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:203)
        at org.eclipse.jdt.internal.core.Openable.openParent(Openable.java:420)
        at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:192)
        at
org.eclipse.jdt.internal.core.JarPackageFragment.generateInfos(JarPackageFragment.java:113)
        at org.eclipse.jdt.internal.core.Openable.openParent(Openable.java:420)
        at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:192)
        at
org.eclipse.jdt.internal.core.BinaryMember.generateInfos(BinaryMember.java:46)
        at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:547)
        at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:291)
        at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:277)
        at
org.eclipse.jdt.internal.core.BinaryMethod.getFlags(BinaryMethod.java:146)
        at org.eclipse.jdt.internal.corext.util.JdtFlags.isEnum(JdtFlags.java:159)
        at
org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoring.isPushable(PushDownRefactoring.java:317)
        at
org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoring.areAllPushable(PushDownRefactoring.java:226)
        at
org.eclipse.jdt.internal.corext.refactoring.structure.PushDownRefactoring.isAvailable(PushDownRefactoring.java:306)
        at
org.eclipse.jdt.ui.actions.PushDownAction.canEnable(PushDownAction.java:177)
        at
org.eclipse.jdt.ui.actions.PushDownAction.selectionChanged(PushDownAction.java:93)
        at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged(SelectionDispatchAction.java:200)
        at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged(SelectionDispatchAction.java:195)
        at
org.eclipse.jdt.internal.ui.typehierarchy.SelectionProviderMediator.fireSelectionChanged(SelectionProviderMediator.java:129)
        at
org.eclipse.jdt.internal.ui.typehierarchy.SelectionProviderMediator.doSelectionChanged(SelectionProviderMediator.java:110)
        at
org.eclipse.jdt.internal.ui.typehierarchy.SelectionProviderMediator$InternalListener.selectionChanged(SelectionProviderMediator.java:39)
        at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
        at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1061)
        at org.eclipse.core.runtime.Platform.run(Platform.java:747)
        at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:161)
        at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1667)
        at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:935)
        at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:961)
        at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:209)
        at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:204)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:364)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:833)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2810)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2455)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1575)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1541)
        at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:287)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
        at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:274)
        at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
        at java.lang.reflect.Method.invoke(Method.java:391)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:255)
        at org.eclipse.core.launcher.Main.run(Main.java:811)
        at org.eclipse.core.launcher.Main.main(Main.java:795)
Comment 1 Andrey Loskutov CLA 2005-06-12 08:51:42 EDT
Eclipse 3.1 RC2:
I have the same behavoir during refactoring of method signatures. If "call 
hierarchy" was caled for some method, and then the signature of this method was 
changed, then I have error if I try to click somewhere in the method call 
hierarchy view:

Java Model Exception: Java Model Status [rotateByte(byte, int, int) {key=Lde/
loskutov/ai/impl/delta/DeltaUtils;.rotateByte(BII)B} [in DeltaUtils [in [Working 
copy] DeltaUtils.java [in de.loskutov.ai.impl.delta [in src [in Optimizer]]]]] 
does not exist]
	at org.eclipse.jdt.internal.core.JavaElement.
newNotPresentException(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.
java:499)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.
java:232)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.
java:218)
	at org.eclipse.jdt.internal.core.Member.getNameRange(Member.java:247)
	at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyUI.
openInEditor(CallHierarchyUI.java:144)
	at org.eclipse.jdt.internal.ui.callhierarchy.OpenLocationAction.
run(OpenLocationAction.java:71)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.
dispatchRun(SelectionDispatchAction.java:222)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.
run(SelectionDispatchAction.java:198)
	at org.eclipse.jdt.internal.ui.callhierarchy.CallHierarchyViewer$1.
open(CallHierarchyViewer.java:57)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:
741)
	at org.eclipse.core.internal.runtime.InternalPlatform.
run(InternalPlatform.java:1038)
	at org.eclipse.core.runtime.Platform.run(Platform.java:775)
	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.fireOpen(StructuredViewer.
java:739)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.
java:968)
	at org.eclipse.jface.viewers.StructuredViewer$6.
handleOpen(StructuredViewer.java:1067)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:
243)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:238)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:
277)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
365)
	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:585)
	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)

Ok, I can understand it, that the view does not refresh the content while 
editing method signature in editor. But if I then say "refresh" in the hierarchy 
view, I get the next error:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.
findIndexMatches(MatchLocator.java:307)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.
search(PatternSearchJob.java:114)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.
execute(PatternSearchJob.java:64)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.
performConcurrentJob(JobManager.java:261)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.
findMatches(BasicSearchEngine.java:193)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.
search(BasicSearchEngine.java:421)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:532)
	at org.eclipse.jdt.internal.corext.callhierarchy.CallerMethodWrapper.
findChildren(CallerMethodWrapper.java:75)
	at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.
performSearch(MethodWrapper.java:253)
	at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.
doFindChildren(MethodWrapper.java:194)
	at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.
getCalls(MethodWrapper.java:76)
	at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.
getCalls(DeferredMethodWrapper.java:62)
	at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.
fetchDeferredChildren(DeferredMethodWrapper.java:80)
	at org.eclipse.ui.progress.DeferredTreeContentManager$1.
run(DeferredTreeContentManager.java:192)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

To reproduce this, simply perform "call hierarchy" on method 
static int foo(int i, int j){
}
and then change the signature to
static int foo(byte i, byte j){
}
and double click on the foo(...) method in the  "call hierarchy".
After the first error you could then try to refresh view, and you should get 
second exception.

P.S.
I propose to change the summary to:
[call hierarchy] CallHierarchy fails after change in Java Model
Comment 2 Markus Keller CLA 2005-06-15 04:24:35 EDT
Indeed, the call hierarchy should listen to java model changes and remove
non-existing elements. Not critical for 3.1.
Comment 3 Markus Keller CLA 2006-01-03 11:23:25 EST
*** Bug 102124 has been marked as a duplicate of this bug. ***
Comment 4 Markus Keller CLA 2006-01-03 11:23:40 EST
*** Bug 66520 has been marked as a duplicate of this bug. ***
Comment 5 Markus Keller CLA 2006-01-03 11:59:46 EST
Code to remove changed elements is similar to SearchResultUpdater.
See also bug 121900 for problems with document changes.
Comment 6 Markus Keller CLA 2006-03-27 12:14:47 EST
I'll try to do this together with bug 121900.
Comment 7 Markus Keller CLA 2006-05-01 15:58:18 EDT
Sorry, didn't make it for 3.2.
Comment 8 Markus Keller CLA 2006-10-25 09:11:56 EDT
*** Bug 162196 has been marked as a duplicate of this bug. ***
Comment 9 Mike Wilson CLA 2008-04-12 11:42:13 EDT
This is marked P2, with a target milestone of 3.4. Do we still believe it will be addressed for 3.4?

Comment 10 Markus Keller CLA 2008-04-14 05:22:25 EDT
(In reply to comment #9)
I don't think I'll find time for this in M7. Moving to 3.5.
The log is no longer filling up with exceptions, thanks to bug 121900 comment 4.
Comment 11 Markus Keller CLA 2009-03-24 12:02:57 EDT
*** Bug 268801 has been marked as a duplicate of this bug. ***
Comment 12 Eclipse Genie CLA 2020-09-06 17:33:03 EDT
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 13 Eclipse Genie CLA 2022-09-30 17:44:39 EDT
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.