Bug 8221 NPE in refactoring preview page (Pull up)
1. select TestCase.setUp and invoke 'Pull Up' 2. In the delete tree check all elements, press next 3. Open the 'VectorTest.java' tree and select the node 'Delete....' -> 4 org.eclipse.core.runtime 0 java.lang.NullPointerException java.lang.NullPointerException at org.eclipse.jdt.internal.ui.refactoring.ComparePreviewer$CompareInput.<init> (ComparePreviewer.java:42) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getCompareInput (PreviewWizardPage.java:211) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getPreviewer (PreviewWizardPage.java:254) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.showPreview (PreviewWizardPage.java:374) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.access$1 (PreviewWizardPage.java:372) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage$2.selectionChanged (PreviewWizardPage.java:363) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java (Compiled Code)) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:999) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:466) at org.eclipse.jface.viewers.CheckboxTreeViewer.handleSelect (CheckboxTreeViewer.java:233) at org.eclipse.jface.viewers.AbstractTreeViewer$1.widgetSelected (AbstractTreeViewer.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:523) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:83) at org.eclipse.jdt.internal.ui.refactoring.actions.OpenRefactoringWizardAction.run (OpenRefactoringWizardAction.java:65) at org.eclipse.jface.action.Action.runWithEvent(Action.java:452) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:827) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:878) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/PasteInCompilationUnitEdit.java
private String fSource;
	private int fType;
	private ICompilationUnit fCu;
	
	protected PasteInCompilationUnitEdit(String source, int type, ICompilationUnit cu) {
		Assert.isNotNull(source);
		fSource= source;
		
		Assert.isTrue(type == IJavaElement.PACKAGE_DECLARATION 
						  || type == IJavaElement.IMPORT_CONTAINER
						  || type == IJavaElement.IMPORT_DECLARATION
						  || type == IJavaElement.TYPE);
		fType= type;				  
		
		Assert.isTrue(cu.exists());
		fCu= cu;
	}
	/*
	 * @see TextEdit#copy()
	 */
	public TextEdit copy() {