Bug 28824 Quick Fix: Type Mismatch -> Cast bug [quick fix]
When using code assist to apply a cast to the following statement: DefaultMutableTreeNode root = getParentContainer().treeMapperTree.getModel ().getRoot(); You get: DefaultMutableTreeNode root = getParentContainer().(DefaultMutableTreeNode) treeMapperTree.getModel().getRoot(); When you should get: DefaultMutableTreeNode root = (DefaultMutableTreeNode) getParentContainer ().treeMapperTree.getModel().getRoot(); Seems to be getting confused about where the cast statement should go because the treeMapperTree isn't using getters (i.e. getTreeMapperTree()). When using getters then the cast works fine... Should also work without getters, hence bug.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingExpressionsTest.java
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);
		proposal.getCompilationUnitChange().setSave(true);
		
		proposal.apply(null);
		
		buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    public void foo() {\n");
		buf.append("        i= k - j;\n");
		buf.append("        j= 1 + 2 + k + 5 + n;\n");
		buf.append("        k= 1 * 2 * 3 * 4 * 5;\n");		
		buf.append("    }\n");
		buf.append("}\n");	
		assertEqualString(cu.getSource(), buf.toString());
		clearRewrite(rewrite);
	}
	public void testInstanceofExpression() throws Exception {
		IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
		StringBuffer buf= new StringBuffer();
		buf.append("package test1;\n");
		buf.append("public class E {\n");
		buf.append("    public void foo() {\n");
		buf.append("        goo(k instanceof Vector);\n");
		buf.append("    }\n");
		buf.append("}\n");	
		ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
		
		CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);