Bug 82504 [compiler][1.5] ClassCastException when parsing a CastExpression between an array type and a type variable
I20050104-1600 + jdt.core v_530a class F<T> { Object[] objectArr; void foo() { T x= (T) objectArr; } } Error 2005-01-10 21:22:57.662 An internal error occurred during: "Java AST creation". java.lang.ClassCastException at org.eclipse.jdt.internal.compiler.ast.Expression.checkCastTypesCompatibility(Expression.java:300) at org.eclipse.jdt.internal.compiler.ast.CastExpression.resolveType(CastExpression.java:376) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:201) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:411) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:160) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:389) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1014) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1063) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:280) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:651) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:443) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:708) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:563) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:494) 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:66)
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java
buf.append("    Object object= null;\n");
		buf.append("    Vector vector= null;\n");
		buf.append("    Socket socket= null;\n");
		buf.append("    Cloneable cloneable= null;\n");
		buf.append("    Collection collection= null;\n");
		buf.append("    Serializable serializable= null;\n");
		buf.append("    Object[] objectArr= null;\n");
		buf.append("    int[] int_arr= null;\n");
		buf.append("    long[] long_arr= null;\n");
		buf.append("    Vector[] vector_arr= null;\n");
		buf.append("    Socket[] socket_arr= null;\n");
		buf.append("    Collection[] collection_arr= null;\n");
		buf.append("    Object[][] objectArrArr= null;\n");
		buf.append("    Collection[][] collection_arrarr= null;\n");
		buf.append("    Vector[][] vector_arrarr= null;\n");
		buf.append("    Socket[][] socket_arrarr= null;\n");
		
		buf.append("    Collection<String> collection_string= null;\n");
		buf.append("    Collection<Object> collection_object= null;\n");
		buf.append("    Collection<Number> collection_number= null;\n");
		buf.append("    Collection<Integer> collection_integer= null;\n");
		buf.append("    Collection<? extends Number> collection_upper_number= null;\n");
		buf.append("    Collection<? super Number> collection_lower_number= null;\n");
		buf.append("    Vector<Object> vector_object= null;\n");
		buf.append("    Vector<Number> vector_number= null;\n");
		buf.append("    Vector<Integer> vector_integer= null;\n");
		buf.append("    Vector<? extends Number> vector_upper_number= null;\n");
		buf.append("    Vector<? super Number> vector_lower_number= null;\n");
		buf.append("    Vector<? extends Exception> vector_upper_exception= null;\n");
		buf.append("    Vector<? super Exception> vector_lower_exception= null;\n");