ModifierRewrite.create(rewrite, declaration).setVisibility(keyword.toFlagValue(), null);
ModifierRewrite.create(rewrite, declaration).setVisibility(keyword == null ? Modifier.NONE : keyword.toFlagValue(), null);
	protected boolean createMethodCopy(final MethodDeclaration declaration, final Map rewrites, final ASTRewrite rewrite, final Map adjustments, final RefactoringStatus status, final IProgressMonitor monitor) throws CoreException {		Assert.isNotNull(declaration);		Assert.isNotNull(rewrites);		Assert.isNotNull(rewrite);		Assert.isNotNull(adjustments);		Assert.isNotNull(status);		Assert.isNotNull(monitor);		boolean target= false;		final IDocument document= new Document(fMethod.getCompilationUnit().getBuffer().getContents());		final CompilationUnitRewrite rewriter= getCompilationUnitRewrite(rewrites, getTargetType().getCompilationUnit());		try {			rewrite.set(declaration, MethodDeclaration.NAME_PROPERTY, rewrite.getAST().newSimpleName(fMethodName), null);			boolean same= false;			final IMethodBinding binding= declaration.resolveBinding();			if (binding != null) {				final ITypeBinding declaring= binding.getDeclaringClass();				if (declaring != null && Bindings.equals(declaring.getPackage(), fTarget.getType().getPackage()))					same= true;				final Modifier.ModifierKeyword keyword= same ? null : Modifier.ModifierKeyword.PUBLIC_KEYWORD;				if (MemberVisibilityAdjustor.hasLowerVisibility(binding.getModifiers(), same ? Modifier.NONE : keyword.toFlagValue()) && MemberVisibilityAdjustor.needsVisibilityAdjustments(fMethod, keyword, adjustments)) {					final MemberVisibilityAdjustor.IncomingMemberVisibilityAdjustment adjustment= new MemberVisibilityAdjustor.IncomingMemberVisibilityAdjustment(fMethod, keyword, RefactoringStatus.createStatus(RefactoringStatus.WARNING, RefactoringCoreMessages.getFormattedString("MemberVisibilityAdjustor.change_visibility_method_warning", new String[] { MemberVisibilityAdjustor.getLabel(fMethod), MemberVisibilityAdjustor.getLabel(keyword)}), JavaStatusContext.create(fMethod), null, RefactoringStatusEntry.NO_CODE, null)); //$NON-NLS-1$					ModifierRewrite.create(rewrite, declaration).setVisibility(keyword.toFlagValue(), null);					adjustment.setNeedsRewriting(false);					adjustments.put(fMethod, adjustment);				}			}			target= createMethodArguments(rewrites, rewrite, declaration, adjustments, status);			createMethodComment(rewrite, declaration);			createMethodBody(rewriter, rewrite, declaration);			final String source= createMethodDeclaration(document, declaration, rewrite);			final MethodDeclaration targetDeclaration= (MethodDeclaration) rewriter.getASTRewrite().createStringPlaceholder(source, ASTNode.METHOD_DECLARATION);			final AbstractTypeDeclaration type= ASTNodeSearchUtil.getAbstractTypeDeclarationNode(getTargetType(), rewriter.getRoot());			rewriter.getASTRewrite().getListRewrite(type, type.getBodyDeclarationsProperty()).insertAt(targetDeclaration, ASTNodes.getInsertionIndex(targetDeclaration, type.bodyDeclarations()), rewriter.createGroupDescription(RefactoringCoreMessages.getString("MoveInstanceMethodProcessor.add_moved_method"))); //$NON-NLS-1$		} catch (MalformedTreeException exception) {			JavaPlugin.log(exception);		} catch (BadLocationException exception) {			JavaPlugin.log(exception);		} finally {			if (fMethod.getCompilationUnit().equals(getTargetType().getCompilationUnit()))				rewriter.clearImportRewrites();		}		return target;	}