Bug 57871 - Override Indicator: blocks editor from opening when error occurs in java compiler
Summary: Override Indicator: blocks editor from opening when error occurs in java comp...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 major (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 57872 58872 60812 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-08 04:59 EDT by Tom Hofmann CLA
Modified: 2004-05-19 09:59 EDT (History)
3 users (show)

See Also:


Attachments
Open Type for CBanner gives two choices (26.35 KB, image/png)
2004-04-22 03:45 EDT, Tom Hofmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hofmann CLA 2004-04-08 04:59:00 EDT
I20040406

Got this when opening StyledText.java (ClassFileEditor):

org.eclipse.ui.PartInitException[0]:
org.eclipse.jdt.internal.compiler.problem.AbortCompilation
	at java.lang.Throwable.<init>(Throwable.java)
	at
org.eclipse.jdt.internal.compiler.problem.AbortCompilation.<init>(AbortCompilation.java:36)
	at
org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java)
	at
org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:1047)
	at
org.eclipse.jdt.internal.compiler.problem.ProblemReporter.isClassPathCorrect(ProblemReporter.java:2123)
	at
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java)
	at
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.methods(BinaryTypeBinding.java)
	at org.eclipse.jdt.core.dom.TypeBinding.getDeclaredMethods(TypeBinding.java)
	at org.eclipse.jdt.internal.corext.dom.Bindings.findMethodInType(Bindings.java)
	at
org.eclipse.jdt.internal.corext.dom.Bindings.findMethodInHierarchy(Bindings.java)
	at
org.eclipse.jdt.internal.corext.dom.Bindings.findMethodInHierarchy(Bindings.java)
	at
org.eclipse.jdt.internal.corext.dom.Bindings.findMethodDefininition(Bindings.java)
	at
org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager$1.visit(OverrideIndicatorManager.java)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java)
	at
org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager.updateAnnotations(OverrideIndicatorManager.java)
	at
org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager.<init>(OverrideIndicatorManager.java:185)
	at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.installOverrideIndicator(JavaEditor.java:3405)
	at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2646)
	at
org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2617)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.doSetInput(ClassFileEditor.java:610)
	at
org.eclipse.ui.texteditor.AbstractTextEditor$14.run(AbstractTextEditor.java:2178)
	at
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:302)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:576)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:573)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1586)
	at
org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:2193)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:2211)
	at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:569)
	at org.eclipse.ui.internal.EditorManager.openInternalEditor(EditorManager.java:633)
	at
org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:438)
	at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:426)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2129)
	at org.eclipse.ui.internal.WorkbenchPage.access$6(WorkbenchPage.java:2072)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2059)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2054)
	at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:145)
	at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:115)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.run(OpenTypeAction.java:67)
	at org.eclipse.jdt.internal.ui.actions.OpenTypeAction.run(OpenTypeAction.java:80)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:269)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:207)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:73)
	at org.eclipse.ui.internal.commands.Command.execute(Command.java:172)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:465)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java)
	at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(Native Method)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_iteration(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1561)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1532)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:257)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:140)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:279)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:241)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
	at java.lang.reflect.Method.invoke(Method.java:386)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:267)
	at org.eclipse.core.launcher.Main.run(Main.java:692)
	at org.eclipse.core.launcher.Main.main(Main.java:676)
Comment 1 Dani Megert CLA 2004-04-08 09:40:18 EDT
Note: bug 57872 has been filed to fix the "real" problem.
Comment 2 Dani Megert CLA 2004-04-20 09:35:04 EDT
I cannot catch an exception since nothing is speced. Catching Throwable isn't
the right thing to do. Moving to J Core to either spec an exception or dispose
this bug.
Comment 3 Philipe Mulet CLA 2004-04-20 19:05:22 EDT
This is an internal compiler exception which shouldn't surface outside.
Comment 4 Olivier Thomann CLA 2004-04-21 11:26:33 EDT
*** Bug 57872 has been marked as a duplicate of this bug. ***
Comment 5 Olivier Thomann CLA 2004-04-21 11:28:01 EDT
Like I stated in bug 57872, I cannot reproduce. As long as I cannot find a
reproducable test case, it won't be fixed. If you have a workspace in which you
can see the problem every time you try a specific action, please zip this
workspace and let me know your steps.
Comment 6 Dani Megert CLA 2004-04-21 11:36:45 EDT
what about bug 58872? This is the second instance of this bug (I guess).
Comment 7 Olivier Thomann CLA 2004-04-21 12:08:48 EDT
Yes, and I tried to reproduce it. But unsuccessfully.
Comment 8 Olivier Thomann CLA 2004-04-21 14:20:10 EDT
Here are my steps:
1) start a fresh workspace using latest integration build
2) Import org.eclipse.jdt.ui from dev.eclipse.org
3) Open type StyledText.
4) Got no problem.


I tried different classes as mentionned in bug 58872 comment 6, but with no
success so far.

Do I need to set any particular options? I have no problem trying one of your
workspace to reproduce it.
Comment 9 Olivier Thomann CLA 2004-04-21 14:20:42 EDT
Sorry was bug 57872 comment 6.
Comment 10 Tom Hofmann CLA 2004-04-22 03:44:39 EDT
Ok, just had it again. I will attach my zipped workspace.

Note: I believe this has to do with the PDE required plug-ins container. When
using Open Type (Ctrl+Shift+T) to open CBanner, I get offered two choices, one
from I20040413 and one from my Target Install (I20040420). The former resides in
the "External Plug-in Libraries" artificial project and can be opened without a
problem, while the latter shows the AbortCompilation error.
Comment 11 Tom Hofmann CLA 2004-04-22 03:45:28 EDT
Created attachment 9828 [details]
Open Type for CBanner gives two choices
Comment 12 Tom Hofmann CLA 2004-04-22 05:00:12 EDT
zipped workspace is 25 MByte -> will mail / offer download to you
Comment 13 Philipe Mulet CLA 2004-04-23 07:41:49 EDT
*** Bug 58872 has been marked as a duplicate of this bug. ***
Comment 14 Olivier Thomann CLA 2004-04-23 14:44:26 EDT
OK, once I checked on Mickael computer what was happening, it was quite simple
to fix it. The problem occurs because on Linux the swt classes are split into 3
jars (swt.jar, swt-pi.jar and swt-mozilla.jar). The problem could only occur on
Linux, not on Windows. This is why I could not reproduce it.
One of the method in the Composite class was referring to a type in swt-pi.jar.
But this jar is not in the search environment (see bug 45767 for further
details) and so the binding resolution failed.
I added guards in the TypeBinding class to return an empty list for methods or
fields or superinterfaces and null for superclass or enclosing type when they
cannot be successfully resolved.
Even if getSuperclass() can potentially return null, the specs says that
checking for java.lang.Object is good enough.
The problem is now to find out what value should be returned by getSuperclass()
when a similar problem can happen resolving the super class. I would say that
null should be returned. I am afraid that null will cause NPE in jdt.ui code if
they only check if the current class is not java.lang.Object.
I can also return java.lang.Object even if this is not true.
I prefer null, but senders needs to protect their code.
Comment 15 Olivier Thomann CLA 2004-04-23 14:52:09 EDT
To be safe I return java.lang.Object for the superclass when it cannot be
resolved, but we should clarify that point.
Comment 16 Olivier Thomann CLA 2004-04-23 16:28:59 EDT
Ok, java.lang.Object is returned when the superclass cannot be resolved.
This makes me wonder why the OverrideIndicatorManager is called before the
ClassFileEditor opens. Asking for a type binding all its methods and so on for
the hierarchy this can potentially be really slow. I'd like to get the class
file editor open asap and then get these overriding indicators.
Fixed and released in HEAD for the management of the AbortCompilation exception.
Comment 17 Dani Megert CLA 2004-04-26 04:16:34 EDT
The AST is not only used for the override indicator but also for syntactic
highlighting (just released this weekend), quick fix, mark occurrences. For the
CU editor we get the AST on reconcile which happens when we open the editor. To
be in sync we do the same for the CF editor.
Comment 18 Olivier Thomann CLA 2004-04-26 10:40:35 EDT
I don't see whay is wrong with my fix. The problem was a case where the bindings
in the hierarchy could not be fully resolved due to missing jars on the
classpath (jars coming from the fragments are not included by the PDE
container). There is nothing else that can be done if the classpath is not fixed.
Discussion in bug 45767 concluded that these jars won't be included.
Comment 19 Dani Megert CLA 2004-04-26 10:44:49 EDT
>I don't see whay is wrong with my fix
nothing.
I tried to explain why we compute the AST for CF editor upon opening. However,
as you suggested in the PR you filed we should do this in a background job.
Comment 20 Olivier Thomann CLA 2004-04-26 10:55:09 EDT
Ok, I misunderstood your statement. Sorry.
Comment 21 Olivier Thomann CLA 2004-05-03 17:05:44 EDT
*** Bug 60812 has been marked as a duplicate of this bug. ***
Comment 22 David Audel CLA 2004-05-19 09:59:30 EDT
Verified for 3.0M9