Bug 412704 - ClassCastException: ProblemFieldBinding cannot be cast to LocalVariableBinding
Summary: ClassCastException: ProblemFieldBinding cannot be cast to LocalVariableBinding
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-07-10 15:10 EDT by Rafael Chaves CLA
Modified: 2022-06-17 19:43 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA 2013-07-10 15:10:23 EDT
Found this in the log, not sure what triggered it.

java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.ProblemFieldBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding
	at org.eclipse.jdt.internal.compiler.ast.SingleNameReference.localVariableBinding(SingleNameReference.java:824)
	at org.eclipse.jdt.internal.compiler.ast.Assignment.resolveType(Assignment.java:192)
	at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:970)
	at org.eclipse.jdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:272)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:510)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:265)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:469)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1185)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1295)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:561)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:770)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.process(CompilationUnitResolver.java:344)
	at org.eclipse.jdt.internal.core.util.BindingKeyResolver.consumeTopLevelType(BindingKeyResolver.java:446)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:609)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:592)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parseTypeArgument(BindingKeyParser.java:935)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parseParameterizedType(BindingKeyParser.java:878)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:623)
	at org.eclipse.jdt.internal.core.util.BindingKeyParser.parse(BindingKeyParser.java:592)
	at org.eclipse.jdt.internal.core.util.BindingKeyResolver.getCompilerBinding(BindingKeyResolver.java:605)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.reportBinding(CompilationUnitResolver.java:1088)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:909)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:581)
	at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:894)
	at org.eclipse.jdt.internal.ui.text.java.LazyGenericTypeProposal.getExpectedType(LazyGenericTypeProposal.java:633)
	at org.eclipse.jdt.internal.ui.text.java.LazyGenericTypeProposal.computeTypeArgumentProposals(LazyGenericTypeProposal.java:331)
	at org.eclipse.jdt.internal.ui.text.java.LazyGenericTypeProposal.apply(LazyGenericTypeProposal.java:221)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:317)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:332)
	at org.eclipse.jdt.internal.ui.text.java.JavaTypeCompletionProposal.apply(JavaTypeCompletionProposal.java:112)
	at org.eclipse.jdt.internal.ui.text.java.AnonymousTypeCompletionProposal.apply(AnonymousTypeCompletionProposal.java:359)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:495)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:940)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:891)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1323)
	at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:808)
	at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:491)
	at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
...
Comment 1 Jay Arthanareeswaran CLA 2013-07-10 23:59:19 EDT
Can't seem to imagine a test case that would cause this. I don't know what we can do here. When you have narrowed down the problem, please let us know.
Comment 2 Stephan Herrmann CLA 2013-07-11 14:21:53 EDT
A SingleNameReference with a ProblemFieldBinding and yet tagged as LOCAL?
Weird...

If that's indeed possible I'd love to see the root cause of it.
Comment 3 Krzysztof Daniel CLA 2013-11-14 03:55:07 EST
*** Bug 421707 has been marked as a duplicate of this bug. ***
Comment 4 Stephan Herrmann CLA 2013-11-14 05:57:57 EST
Can you name the source code that trigger this exception in bug 421707 ?
Comment 5 Eclipse Genie CLA 2020-06-15 20:28:06 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 6 Eclipse Genie CLA 2022-06-17 19:43:13 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.