if (!fCancelled) { replaceJarFile(new SubProgressMonitor(monitor, 100, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)); if (history != null) RefactoringCore.getUndoManager().flush(); }
if (history != null) RefactoringCore.getUndoManager().flush();
	private void resetClassPath(final IProgressMonitor monitor) throws CoreException {		try {			monitor.beginTask(JarImportMessages.JarImportWizard_cleanup_import, 200);			if (fJavaProject != null) {				final IClasspathEntry[] entries= fJavaProject.readRawClasspath();				final boolean rename= fImportData.isRenameJarFile();				if (rename && !fCancelled) {					final IPackageFragmentRoot root= fImportData.getPackageFragmentRoot();					if (root != null) {						final IClasspathEntry entry= root.getRawClasspathEntry();						for (int index= 0; index < entries.length; index++) {							if (entries[index].equals(entry)) {								final IPath path= getTargetPath(entries[index]);								if (path != null)									entries[index]= JavaCore.newLibraryEntry(path, entries[index].getSourceAttachmentPath(), entries[index].getSourceAttachmentRootPath(), entries[index].getAccessRules(), entries[index].getExtraAttributes(), entries[index].isExported());							}						}					}				}				final RefactoringHistory history= fImportData.getRefactoringHistory();				if (!fCancelled) {					replaceJarFile(new SubProgressMonitor(monitor, 100, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));					if (history != null)						RefactoringCore.getUndoManager().flush();				}				if (history != null || rename)					fJavaProject.setRawClasspath(entries, rename, new SubProgressMonitor(monitor, 60, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));				fJavaProject= null;			}			if (fSourceFolder != null) {				final URI uri= fSourceFolder.getRawLocationURI();				final IFileStore store= EFS.getStore(uri);				if (store.fetchInfo(EFS.NONE, new SubProgressMonitor(monitor, 10, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)).exists())					store.delete(EFS.NONE, new SubProgressMonitor(monitor, 10, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));				fSourceFolder.delete(true, false, new SubProgressMonitor(monitor, 20, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));				fSourceFolder= null;			}		} finally {			monitor.done();		}	}