if (unit != null) {  unit.copy(fragment, null, fileName, true, monitor); return; }  } catch (JavaModelException x) { }
	protected void performSaveAs(IProgressMonitor progressMonitor) {				Shell shell= getSite().getShell();				SaveAsDialog dialog= new SaveAsDialog(shell);		IEditorInput input = getEditorInput();				IFile original= null;		if (input instanceof IFileEditorInput)			original= ((IFileEditorInput) input).getFile();					if (original != null)			dialog.setOriginalFile(original);					if (dialog.open() == Dialog.CANCEL) {			if (progressMonitor != null)				progressMonitor.setCanceled(true);			return;		}					IPath filePath= dialog.getResult();		if (filePath == null) {			if (progressMonitor != null)				progressMonitor.setCanceled(true);			return;		}					filePath= filePath.removeTrailingSeparator();		final String fileName= filePath.lastSegment();		IPath folderPath= filePath.removeLastSegments(1);		if (folderPath == null) {			if (progressMonitor != null)				progressMonitor.setCanceled(true);						return;		}				IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();				/*		 * 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails		 */		final IPackageFragment fragment= getPackage(root, folderPath);				IFile file= root.getFile(filePath);				/*		 * Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=8873		 * Problem caused by http://dev.eclipse.org/bugs/show_bug.cgi?id=9351		 * Will be removed if #9351 is solved.		 */		if (original != null && original.equals(file)) {			doSave(progressMonitor);			return;		}		/* end of fix */				final FileEditorInput newInput= new FileEditorInput(file);				WorkspaceModifyOperation op= new WorkspaceModifyOperation() {			public void execute(final IProgressMonitor monitor) throws CoreException {								if (fragment != null) {					try {													// copy to another package						IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();						ICompilationUnit unit= manager.getWorkingCopy(getEditorInput());												/*						 * 1GJXY0L: ITPJUI:WINNT - NPE during save As in Java editor						 * Introduced null check, just go on in the null case						 */						if (unit != null) {							/* 							 * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there							 * Changed false to true.							 */							unit.copy(fragment, null, fileName, true, monitor);							return;						}											} catch (JavaModelException x) {					}				}								// if (fragment == null) then copy to a directory which is not a package				// if (unit == null) copy the file that is not a compilation unit								/* 				 * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there				 * Changed false to true.				 */				getDocumentProvider().saveDocument(monitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);			}		};				boolean success= false;		try {						if (fragment == null)				getDocumentProvider().aboutToChange(newInput);						new ProgressMonitorDialog(shell).run(false, true, op);			setInput(newInput);			success= true;					} catch (InterruptedException x) {		} catch (InvocationTargetException x) {						/* 			 * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there			 * Missing resources.			 */									Throwable t= x.getTargetException();			if (t instanceof CoreException) {				CoreException cx= (CoreException) t;				ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), cx.getStatus()); //$NON-NLS-1$ //$NON-NLS-2$			} else {				MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title3"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message3") + t.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$			}					} finally {						if (fragment == null)				getDocumentProvider().changed(newInput);							if (progressMonitor != null)				progressMonitor.setCanceled(!success);		}	}