Project: JDT
Bug 7471 JavaModelException in type hierarchy
Reported: 2002-01-11 05:04:07 | Status: resolved fixed

From 7442 (only the bottom part is relevant for this PR). Martin why are we logging this exception? It looks like a case that can happen and that we should handle. ==== I was debugging a new plug-in when the UI in the master workbench froze on me. I was playing around with the editor's title. I had implemented a getTitle() method, but then commented out the method and put in a setInitializationData method (which only does a super to the EditorPart implementation). I had set a breakpoint in my editor's setInitializationData method. The runtime hit the breakpoint, and I clicked on step into in the debugger. A dialog appeared prompting me for the source path for rt.jar (why? The code wasn't in rt.jar). It was impossible to give the dialog focus, and since it was modal it effectively froze my UI. I had two windows open at the time: my workbench and a debug window. In the workbench I had a Packages view and a Hierarchy view (sharing one pane, Hierarchy view on top) and an Outline view. The hierarchy view was showing the hierarchy for BOEditor (a subclass of EditorPart with no subclasses of its own). Note that getTitle() had been removed from the hierarchy view's methods list, as well as from the Outline's. I found the following stack trace in my .log file: Log: Thu Jan 10 12:29:34 EST 2002 4 org.eclipse.jdt.ui 1 Internal Error Java Model Exception: Java Model Status [getTitle does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:448) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java(Compiled Code)) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java(Compiled Code)) at org.eclipse.jdt.internal.core.SourceMethod.isConstructor (SourceMethod.java(Compiled Code)) at org.eclipse.jdt.internal.ui.typehierarchy.MethodsViewer.findSimilarMethod (MethodsViewer.java:372) at org.eclipse.jdt.internal.ui.typehierarchy.MethodsViewer.handleInvalidSelection (MethodsViewer.java:354) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection (StructuredViewer.java(Compiled Code)) at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:623) at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:591) at org.eclipse.jdt.internal.ui.typehierarchy.MethodsContentProvider.doTypeHierarchy Changed(MethodsContentProvider.java:183) at org.eclipse.jdt.internal.ui.typehierarchy.MethodsContentProvider.access$0 (MethodsContentProvider.java:170) at org.eclipse.jdt.internal.ui.typehierarchy.MethodsContentProvider$1.run (MethodsContentProvider.java:163) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java(Compiled Code)) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop (EventLoopProgressMonitor.java(Compiled Code)) at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.subTask (EventLoopProgressMonitor.java(Compiled Code)) at org.eclipse.core.runtime.ProgressMonitorWrapper.subTask (ProgressMonitorWrapper.java(Compiled Code)) at org.eclipse.core.runtime.SubProgressMonitor.subTask (SubProgressMonitor.java(Compiled Code)) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java(Compiled Code)) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1237) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation (AbstractTextEditor.java:1485) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperatio n(CompilationUnitEditor.java:592) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave (CompilationUnitEditor.java:640) at org.eclipse.ui.internal.EditorManager$9.run(EditorManager.java:785) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:296) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:335) at org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation (EditorManager.java:643) at org.eclipse.ui.internal.EditorManager.saveEditor (EditorManager.java:790) at org.eclipse.ui.internal.WorkbenchPage.saveEditor (WorkbenchPage.java:1309) at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:32) at org.eclipse.jface.action.Action.runWithEvent(Action.java:452) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:798) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:821) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.Main.main(Main.java:362) 4 org.eclipse.jdt.core 969 getTitle does not exist.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java