Summary: | [compiler] CCE in compiler: MissingTypeBinding cannot be cast to ProblemReferenceBinding | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | jerome_lanneluc, Olivier_Thomann, philippe_mulet | ||||
Version: | 3.4 | ||||||
Target Milestone: | 3.4 M7 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Markus Keller
2008-03-27 11:55:09 EDT
Hm, going back to I20080326-1950 did not really help, now get tons of these in the log: org.eclipse.jdt.internal.compiler.problem.AbortCompilation at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:121) at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:179) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:1830) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.isClassPathCorrect(ProblemReporter.java:3702) at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:54) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:101) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:137) at org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1382) at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2468) at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2169) at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:44) at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:130) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:197) at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1408) at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1106) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.availableMethods(ReferenceBinding.java:174) at org.eclipse.jdt.core.dom.TypeBinding.getDeclaredMethods(TypeBinding.java:233) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInType(Bindings.java:439) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:456) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:467) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:461) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethodInHierarchy(Bindings.java:461) at org.eclipse.jdt.internal.corext.dom.Bindings.findOverriddenMethod(Bindings.java:490) at org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager$1.visit(OverrideIndicatorManager.java:181) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:486) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2548) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:213) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2478) at org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager.updateAnnotations(OverrideIndicatorManager.java:174) at org.eclipse.jdt.internal.ui.javaeditor.OverrideIndicatorManager.reconciled(OverrideIndicatorManager.java:253) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.reconciled(CompilationUnitEditor.java:1617) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconciled(JavaReconcilingStrategy.java:210) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconciled(JavaCompositeReconcilingStrategy.java:161) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:110) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) I cannot reproduce using I20080327-0100 and perform a Project->Clean..->Clean all projects on a Eclipse 3.4 full-source workspace... Any hints to help us to reproduce? Looking at the source code, it seems possible to get a CCE, so we should protect this path. The workspace needs to contain missing types in order to be able to reproduce this issue. Strange though, as this code hasn't changed in a while... so there would be something else to cause some missing types to appear... Anyway, Markus a testcase is still welcome. My workspace is 100% error-free. I just tried to compile it again with I20080327-0100 (and I20080327-0100 as Target Platform), and I didn't get the exceptions any more. However, I got 3 errors like these when the build was done: - The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project org.eclipse.ui.examples.job Unknown Java Problem - The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files SlowElementAdapter.java org.eclipse.ui.examples.job/src/org/eclipse/ui/examples/jobs/views line 1 Java Problem I occasionally get into such a state, but I have never found steps to reproduce in a fresh workspace. In fact all check for isValidBinding() are not sufficient anymore to cast into a ProblemReferenceBinding. That was already the case since 3.3, where we had invalid binding for missing binary type. Normally this code path should always reach the point where a ProblemReferenceBinding is surfaced. This doesn't seem the case always, and working around here may hide the real issue elsewhere. Created attachment 94104 [details]
Workaround
Will release the workaround for M7, since it is a trivial fix, but there is no steps to reproduce so this will not be easy to verify. Markus - can we rely on you to tell whether this is fixed ? Released for 3.4M7. Fixed (In reply to comment #9) > Markus - can we rely on you to tell whether this is fixed ? Unfortunately not. I've only had the CCE once, and never since. Usually, compilation works fine, but occasionally I get into the trouble of comment 5 (mostly when I start up with a new build and the changed target platform triggers a full build). I have verified for 3.4M7 that the workaround is present in I20080427-2000 |