return (int) (predecessor.getTimeStamp() - successor.getTimeStamp());
final long delta= predecessor.getTimeStamp() - successor.getTimeStamp(); if (delta > 0) return 1; else if (delta < 0) return -1; return 0;
	private boolean performExport() {		RefactoringDescriptorProxy[] writable= fRefactoringDescriptors;		if (fScriptLocation != null) {			final File file= new File(fScriptLocation);			if (file.exists()) {				final MessageDialog message= new MessageDialog(getShell(), getShell().getText(), null, Messages.format(ScriptingMessages.CreateRefactoringScriptWizard_overwrite_query, new String[] { ScriptingMessages.CreateRefactoringScriptWizard_merge_button, ScriptingMessages.CreateRefactoringScriptWizard_overwrite_button}), MessageDialog.QUESTION, new String[] { ScriptingMessages.CreateRefactoringScriptWizard_merge_button, ScriptingMessages.CreateRefactoringScriptWizard_overwrite_button, IDialogConstants.CANCEL_LABEL}, 0);				final int result= message.open();				if (result == 0) {					InputStream stream= null;					try {						stream= new BufferedInputStream(new FileInputStream(file));						final RefactoringDescriptorProxy[] existing= RefactoringCore.getHistoryService().readRefactoringHistory(stream, RefactoringDescriptor.NONE).getDescriptors();						final Set set= new HashSet();						for (int index= 0; index < existing.length; index++)							set.add(existing[index]);						for (int index= 0; index < fRefactoringDescriptors.length; index++)							set.add(fRefactoringDescriptors[index]);						writable= new RefactoringDescriptorProxy[set.size()];						set.toArray(writable);					} catch (FileNotFoundException exception) {						MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, exception.getLocalizedMessage());						return true;					} catch (CoreException exception) {						final Throwable throwable= exception.getStatus().getException();						if (throwable instanceof IOException) {							MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, throwable.getLocalizedMessage());							return true;						} else {							RefactoringUIPlugin.log(exception);							return false;						}					} finally {						if (stream != null) {							try {								stream.close();							} catch (IOException exception) {								// Do nothing							}						}					}				} else if (result == 2)					return false;			}			OutputStream stream= null;			try {				stream= new BufferedOutputStream(new FileOutputStream(file));				Arrays.sort(writable, new Comparator() {					public final int compare(final Object first, final Object second) {						final RefactoringDescriptorProxy predecessor= (RefactoringDescriptorProxy) first;						final RefactoringDescriptorProxy successor= (RefactoringDescriptorProxy) second;						return (int) (predecessor.getTimeStamp() - successor.getTimeStamp());					}				});				RefactoringCore.getHistoryService().writeRefactoringDescriptors(writable, stream, RefactoringDescriptor.NONE, false, new NullProgressMonitor());				return true;			} catch (CoreException exception) {				final Throwable throwable= exception.getStatus().getException();				if (throwable instanceof IOException) {					MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, throwable.getLocalizedMessage());					return true;				} else {					RefactoringUIPlugin.log(exception);					return false;				}			} catch (FileNotFoundException exception) {				MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, exception.getLocalizedMessage());				return true;			} finally {				if (stream != null) {					try {						stream.close();					} catch (IOException exception) {						// Do nothing					}				}			}		} else if (fUseClipboard) {			try {				final ByteArrayOutputStream stream= new ByteArrayOutputStream(2048);				Arrays.sort(writable, new Comparator() {					public final int compare(final Object first, final Object second) {						final RefactoringDescriptorProxy predecessor= (RefactoringDescriptorProxy) first;						final RefactoringDescriptorProxy successor= (RefactoringDescriptorProxy) second;						return (int) (predecessor.getTimeStamp() - successor.getTimeStamp());					}				});				RefactoringCore.getHistoryService().writeRefactoringDescriptors(writable, stream, RefactoringDescriptor.NONE, false, new NullProgressMonitor());				try {					final String string= stream.toString(IRefactoringSerializationConstants.OUTPUT_ENCODING);					Clipboard clipboard= null;					try {						clipboard= new Clipboard(getShell().getDisplay());						try {							clipboard.setContents(new Object[] { string}, new Transfer[] { TextTransfer.getInstance()});							return true;						} catch (SWTError error) {							MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, error.getLocalizedMessage());							return false;						}					} finally {						if (clipboard != null)							clipboard.dispose();					}				} catch (UnsupportedEncodingException exception) {					// Does not happen					return false;				}			} catch (CoreException exception) {				final Throwable throwable= exception.getStatus().getException();				if (throwable instanceof IOException) {					MessageDialog.openError(getShell(), RefactoringUIMessages.ChangeExceptionHandler_refactoring, throwable.getLocalizedMessage());					return true;				} else {					RefactoringUIPlugin.log(exception);					return false;				}			}		}		return false;	}