res= TypeRules.canCast(b2, b1); assertTrue(line, false);
errors.append(line).append('\n');
	public void testCanCast() throws Exception {		VariableDeclarationFragment[] targets= createVariables();		for (int k= 0; k < targets.length; k++) {			for (int n= 0; n < targets.length; n++) {				VariableDeclarationFragment f1= targets[k];				VariableDeclarationFragment f2= targets[n];								String castType= f2.resolveBinding().getType().getQualifiedName();				String line= castType + " x= (" + castType + ") " + f1.getName().getIdentifier();								StringBuffer buf= new StringBuffer();				buf.append("package test1;\n");				buf.append("public class F extends E {\n");				buf.append("    void foo() {\n");				buf.append("        ").append(line).append(";\n");				buf.append("    }\n");				buf.append("}\n");				char[] content= buf.toString().toCharArray();								ASTParser parser= ASTParser.newParser(AST.JLS3);				parser.setSource(content);				parser.setResolveBindings(true);				parser.setProject(fJProject1);				parser.setUnitName("F.java");								CompilationUnit astRoot= (CompilationUnit) parser.createAST(null);				IProblem[] problems= astRoot.getProblems();				ITypeBinding b1= f1.resolveBinding().getType();				assertNotNull(b1);				ITypeBinding b2= f2.resolveBinding().getType();				assertNotNull(b2);				boolean res= TypeRules.canCast(b2, b1);				if (res != (problems.length == 0)) {					res= TypeRules.canCast(b2, b1);					assertTrue(line, false);				}			}			}	}