if (declNode.getParent() instanceof FieldDeclaration) { FieldDeclaration fieldDecl= (FieldDeclaration) declNode.getParent();
ASTNode parent= declNode.getParent(); if (parent instanceof FieldDeclaration) { FieldDeclaration fieldDecl= (FieldDeclaration) parent;
	protected ASTRewrite getRewrite() throws CoreException {		ASTRewrite rewrite;		CompilationUnit astRoot= ASTResolving.findParentCompilationUnit(fNode);		ASTNode boundNode= astRoot.findDeclaringNode(fBinding);		ASTNode declNode= null;		if (boundNode != null) {			fIsInDifferentCU= false;			rewrite= new ASTRewrite(astRoot);			declNode= boundNode;		} else {			fIsInDifferentCU= true;			CompilationUnit newRoot= AST.parseCompilationUnit(getCompilationUnit(), true);			rewrite= new ASTRewrite(newRoot);						declNode= newRoot.findDeclaringNode(fBinding.getKey());		}		if (declNode != null) {			AST ast= declNode.getAST();			if (declNode instanceof MethodDeclaration) {				MethodDeclaration methodDecl= (MethodDeclaration) declNode;				int newModifiers= (methodDecl.getModifiers() & ~fExcludedModifiers) | fIncludedModifiers;								MethodDeclaration modifiedNode= ast.newMethodDeclaration();				modifiedNode.setConstructor(methodDecl.isConstructor()); // no change				modifiedNode.setExtraDimensions(methodDecl.getExtraDimensions()); // no change				modifiedNode.setModifiers(newModifiers);								rewrite.markAsModified(methodDecl, modifiedNode);			} else if (declNode instanceof VariableDeclarationFragment) {				if (declNode.getParent() instanceof FieldDeclaration) {					FieldDeclaration fieldDecl= (FieldDeclaration) declNode.getParent();					int newModifiers= (fieldDecl.getModifiers() & ~fExcludedModifiers) | fIncludedModifiers;										FieldDeclaration modifiedNode= ast.newFieldDeclaration(ast.newVariableDeclarationFragment());					modifiedNode.setModifiers(newModifiers);										rewrite.markAsModified(fieldDecl, modifiedNode);									}			} else if (declNode instanceof TypeDeclaration) {				TypeDeclaration typeDecl= (TypeDeclaration) declNode;				int newModifiers= (typeDecl.getModifiers() & ~fExcludedModifiers) | fIncludedModifiers;								TypeDeclaration modifiedNode= ast.newTypeDeclaration();				modifiedNode.setInterface(typeDecl.isInterface()); // no change				modifiedNode.setModifiers(newModifiers);								rewrite.markAsModified(typeDecl, modifiedNode);							}		}				return rewrite;	}