Bug 94945

Summary: Compiler error prevents further development
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P2 CC: daniel_megert, doo
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2005-05-12 08:53:02 EDT
Build 20050509

In an editor for file X.java, paste following code:
public class X {
	boolean run(X x) {
		return false;
	}
	<T> void run(Class<T> ct) {
	}
	public static void main(String[] args) {
		boolean b = new X().run(new X(){});
	}
}

This will cause an exception in compiler (bug 94928) in build 20050509.
However, the consequence is that no action can be performed any longer once this
occurs in reconciler, as dialogs keep opening.

Either we should:
- catch these properly in reconcile operation (like the builder/batch does) and
convert into IProblem
- improve UI handling to stop looping
Comment 1 Philipe Mulet CLA 2005-05-12 08:53:53 EDT
Dani - wasn't the editor supposed to be more robust ?
Comment 2 Philipe Mulet CLA 2005-05-12 08:56:48 EDT
!ENTRY org.eclipse.core.runtime 4 2 2005-05-12 14:46:58.118
!MESSAGE An internal error occurred during: "Requesting Java AST from selection".
!STACK 0
java.lang.NullPointerException
        at
org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:86)
        at
org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:361)
        at
org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1153)
        at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:2156)
        at
org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:314)
        at
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:201)
        at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:415)
        at
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:169)
        at
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:393)
        at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1063)
        at
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1112)
        at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:305)
        at
org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:826)
        at
org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:503)
        at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:761)
        at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:570)
        at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:556)
        at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:487)
        at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:
165)
        at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)
Comment 3 Philipe Mulet CLA 2005-05-12 09:00:20 EDT
When this occurs, I cannot get rid of the dialog, and further save or exit.
Only solution is ctrl-C.

Comment 4 Dani Megert CLA 2005-05-12 09:29:35 EDT
>Dani - wasn't the editor supposed to be more robust ?
No, at no places in JDT UI we catch RuntimeException.
Comment 5 Jerome Lanneluc CLA 2005-05-12 09:33:13 EDT
Note that the exception is not surfaced to the user during building because the
Build Manager (Platform Core) runs the Java Builder in an ISafeRunnable. So the
exception is simply logged.
Comment 6 Dani Megert CLA 2005-05-12 09:36:29 EDT
For RC1 I will do the same for
- reconciling
- ast creation
Comment 7 Jerome Lanneluc CLA 2005-05-12 17:01:49 EDT
Thanks Dani. Since you're going to fix bug 94951, no action is planned on this one.

Closing.
Comment 8 Dani Megert CLA 2005-05-12 17:06:19 EDT
Yes, Philippe urged me sooo much (;-) and comment 5 gave the final go for it.
And of course I want the editor to look good!
Comment 9 Michael Valenta CLA 2005-08-03 16:35:36 EDT
*** Bug 105067 has been marked as a duplicate of this bug. ***