Bug 20151 Copy/Paste inserts two new lines [ccp]
F3 - select a method in ouliner - copy - select CU - paste observe: method has two trailing newlines. There should be only one. May be this is a regression of the CodeFormatter fix
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/PasteSourceReferencesFromClipboardAction.java
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.ISourceReference;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
import org.eclipse.jdt.internal.corext.codemanipulation.MemberEdit;
import org.eclipse.jdt.internal.corext.refactoring.Assert;
import org.eclipse.jdt.internal.corext.refactoring.reorg.SourceReferenceUtil;
import org.eclipse.jdt.internal.corext.refactoring.util.WorkingCopyUtil;
import org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer;
import org.eclipse.jdt.internal.corext.textmanipulation.TextBufferEditor;
import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.corext.util.Strings;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
public class PasteSourceReferencesFromClipboardAction extends SelectionDispatchAction {
	private Clipboard fClipboard;
	protected PasteSourceReferencesFromClipboardAction(IWorkbenchSite site, Clipboard clipboard) {
		super(site);
		fClipboard= clipboard; 
	}
	
	protected void selectionChanged(IStructuredSelection selection) {
		setEnabled(canOperateOn(selection));
	}
	public boolean canOperateOn(IStructuredSelection selection) {
		try{
			if (! isAnythingToPaste())
				return false;