Bug 341480 - Exception when viewing LinkedHashMap contents
Summary: Exception when viewing LinkedHashMap contents
Status: CLOSED DUPLICATE of bug 338629
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-31 09:17 EDT by Lauri Pekonen CLA
Modified: 2011-03-31 13:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauri Pekonen CLA 2011-03-31 09:17:00 EDT
Build Identifier: M20110210-1200

Exception processing async thread queue
org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

Reproducible: Always

Steps to Reproduce:
Run the following class with debug, set breakpoint to the designated line and try to view contents of "results".

package test;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class DebugTest {

    public static void main(String[] args) {
        Map<String, List<String>> results = new LinkedHashMap<String, List<String>>();
        List<String> result = new ArrayList<String>();
        results.put("test", result);
        System.out.println(results); // breakpoint here
    }

}
Comment 1 Michael Rennie CLA 2011-03-31 10:07:26 EDT
Can you attach the entire stacktrace? This is looking like a dupe of bug 338629.
Comment 2 Lauri Pekonen CLA 2011-03-31 10:23:24 EDT
!ENTRY org.eclipse.jdt.debug 4 120 2011-03-31 16:23:10.043
!MESSAGE Exception processing async thread queue
!SUBENTRY 1 org.eclipse.jdt.debug 4 120 2011-03-31 16:23:10.043
!MESSAGE Exception processing async thread queue
!STACK 0
java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.isProvablyDistinct(TypeBinding.java:633)
	at org.eclipse.jdt.internal.compiler.ast.Expression.checkUnsafeCast(Expression.java:526)
	at org.eclipse.jdt.internal.compiler.ast.Expression.checkCastTypesCompatibility(Expression.java:486)
	at org.eclipse.jdt.core.dom.TypeBinding.isCastCompatible(TypeBinding.java:1014)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.getEnclosingLevel(ASTInstructionCompiler.java:406)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.visit(ASTInstructionCompiler.java:2757)
	at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:237)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
	at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:136)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
	at org.eclipse.jdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2528)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:504)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:484)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2551)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:219)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.createExpressionFromAST(ASTEvaluationEngine.java:414)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluationEngine.java:361)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluationEngine.java:331)
	at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.getCompiledExpression(JavaDetailFormattersManager.java:395)
	at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.resolveFormatter(JavaDetailFormattersManager.java:158)
	at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.access$1(JavaDetailFormattersManager.java:143)
	at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager$2.run(JavaDetailFormattersManager.java:138)
	at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:2756)
Comment 3 Lauri Pekonen CLA 2011-03-31 10:24:38 EDT
Seems like the same stack, so now this should be reproducible always?
Comment 4 Michael Rennie CLA 2011-03-31 11:02:10 EDT
(In reply to comment #3)
> Seems like the same stack, so now this should be reproducible always?

Not necessarily. I tried to reproduce using the steps and snippet you provided and did not get the exception (using I20110329-0800 on Win7 64bit and Linux 64bit).

Marking as a dupe of 338629

*** This bug has been marked as a duplicate of bug 338629 ***
Comment 5 Lauri Pekonen CLA 2011-03-31 11:19:23 EDT
So now these two bugs are duplicates of Bug 317046, which is VERIFIED FIXED? Does it mean this bug is also considered fixed? Sorry if this is a stupid question.
Comment 6 Michael Rennie CLA 2011-03-31 13:32:01 EDT
(In reply to comment #5)
> So now these two bugs are duplicates of Bug 317046, which is VERIFIED FIXED?
> Does it mean this bug is also considered fixed? Sorry if this is a stupid
> question.

Yes, the reported issue has been fixed in versions of Eclipse >= 3.7M2 (I20100909-1700)
Comment 7 Lauri Pekonen CLA 2011-03-31 13:52:15 EDT
Ah now I see. So Helios will not get this fix.