rewrite.markAsReplaced(fragment, VariableDeclarationFragment.EXTRA_DIMENSIONS_PROPERTY, new Integer(4), null);
rewrite.set(fragment, VariableDeclarationFragment.EXTRA_DIMENSIONS_PROPERTY, new Integer(4), null);
	public void testVariableDeclarationFragment() 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("        int i, j, k= 0, x[][], y[]= {0, 1};\n");				buf.append("    }\n");		buf.append("}\n");			ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);				CompilationUnit astRoot= createAST(cu);		NewASTRewrite rewrite= new NewASTRewrite(astRoot.getAST());				AST ast= astRoot.getAST();				assertTrue("Parse errors", (astRoot.getFlags() & ASTNode.MALFORMED) == 0);		TypeDeclaration type= findTypeDeclaration(astRoot, "E");		MethodDeclaration methodDecl= findMethodDeclaration(type, "foo");		Block block= methodDecl.getBody();		List statements= block.statements();		assertTrue("Number of statements not 1", statements.size() == 1);				VariableDeclarationStatement variableDeclStatement= (VariableDeclarationStatement) statements.get(0);		List fragments= variableDeclStatement.fragments();		assertTrue("Number of fragments not 5", fragments.size() == 5);				{ // rename var, add dimension			VariableDeclarationFragment fragment= (VariableDeclarationFragment) fragments.get(0);						ASTNode name= ast.newSimpleName("a");			rewrite.markAsReplaced(fragment.getName(), name);						rewrite.markAsReplaced(fragment, VariableDeclarationFragment.EXTRA_DIMENSIONS_PROPERTY, new Integer(2), null);		}				{ // add initializer			VariableDeclarationFragment fragment= (VariableDeclarationFragment) fragments.get(1);						assertTrue("Has initializer", fragment.getInitializer() == null);						Expression initializer= ast.newNumberLiteral("1");			rewrite.markAsInsert(fragment, VariableDeclarationFragment.INITIALIZER_PROPERTY, initializer, null);		}				{ // remove initializer			VariableDeclarationFragment fragment= (VariableDeclarationFragment) fragments.get(2);						assertTrue("Has no initializer", fragment.getInitializer() != null);			rewrite.markAsRemoved(fragment.getInitializer());		}		{ // add dimension, add initializer			VariableDeclarationFragment fragment= (VariableDeclarationFragment) fragments.get(3);									rewrite.markAsReplaced(fragment, VariableDeclarationFragment.EXTRA_DIMENSIONS_PROPERTY, new Integer(4), null);			assertTrue("Has initializer", fragment.getInitializer() == null);						Expression initializer= ast.newNullLiteral();			rewrite.markAsInsert(fragment, VariableDeclarationFragment.INITIALIZER_PROPERTY, initializer, null);		}		{ // remove dimension			VariableDeclarationFragment fragment= (VariableDeclarationFragment) fragments.get(4);									rewrite.markAsReplaced(fragment, VariableDeclarationFragment.EXTRA_DIMENSIONS_PROPERTY, new Integer(0), null);		}										String preview= evaluateRewrite(cu, rewrite);				buf= new StringBuffer();		buf.append("package test1;\n");		buf.append("public class E {\n");		buf.append("    public void foo() {\n");		buf.append("        int a[][], j = 1, k, x[][][][] = null, y= {0, 1};\n");				buf.append("    }\n");		buf.append("}\n");			assertEqualString(preview, buf.toString());	}