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
SingleVariableDeclaration secondParam= (SingleVariableDeclaration) params.get(1);
			
			ExpressionStatement stmt= (ExpressionStatement) statements.get(0);
			MethodInvocation invocation= (MethodInvocation) stmt.getExpression();
			List arguments= invocation.arguments();
			SimpleName first= (SimpleName) arguments.get(0);
			SimpleName second= (SimpleName) arguments.get(1);
			
			
			SimpleName newFirstArg= methodDecl.getAST().newSimpleName("yyy");
			SimpleName newSecondArg= methodDecl.getAST().newSimpleName("bb");
			rewrite.markAsReplaced(first, newFirstArg);
			rewrite.markAsReplaced(second, newSecondArg);
			
			
			SimpleName newFirstName= methodDecl.getAST().newSimpleName("yyy");
			SimpleName newSecondName= methodDecl.getAST().newSimpleName("bb");
			rewrite.markAsReplaced(firstParam.getName(), newFirstName);
			rewrite.markAsReplaced(secondParam.getName(), newSecondName);
			
			
			ASTNode paramplaceholder1= rewrite.createCopy(firstParam);
			ASTNode paramplaceholder2= rewrite.createCopy(secondParam);
			
			rewrite.markAsReplaced(firstParam, paramplaceholder2);
			rewrite.markAsReplaced(secondParam, paramplaceholder1);
			
			
			ASTNode placeholder1= rewrite.createCopy(first);
			ASTNode placeholder2= rewrite.createCopy(second);