final String string= Long.valueOf(stamp).toString();
final String string= Long.toString(stamp);
	void addRefactoringDescriptor(final RefactoringDescriptor descriptor, boolean sort, final IProgressMonitor monitor) throws CoreException {		try {			monitor.beginTask(RefactoringCoreMessages.RefactoringHistoryService_updating_history, 5);			final long stamp= descriptor.getTimeStamp();			if (stamp >= 0) {				final IPath path= stampToPath(stamp);				final IFileStore folder= fHistoryStore.getChild(path);				if (folder != null) {					final IFileStore history= folder.getChild(RefactoringHistoryService.NAME_HISTORY_FILE);					final IFileStore index= folder.getChild(RefactoringHistoryService.NAME_INDEX_FILE);					if (history != null && index != null) {						if (history.fetchInfo(EFS.NONE, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)).exists()) {							InputStream input= null;							try {								input= new BufferedInputStream(history.openInputStream(EFS.NONE, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)));								final Document document= getCachedDocument(path, input);								try {									input.close();									input= null;								} catch (IOException exception) {									// Do nothing								}								monitor.worked(1);								final Object result= transformDescriptor(descriptor, false);								if (result instanceof Document) {									boolean found= false;									final NodeList list= ((Document) result).getElementsByTagName(IRefactoringSerializationConstants.ELEMENT_REFACTORING);									final Element root= document.getDocumentElement();									if (sort) {										final String string= Long.valueOf(stamp).toString();										for (int offset= 0; offset < list.getLength(); offset++) {											final Element element= (Element) list.item(offset);											final String attribute= element.getAttribute(IRefactoringSerializationConstants.ATTRIBUTE_STAMP);											if (attribute != null) {												if (string.compareTo(attribute) > 0) {													root.insertBefore(document.importNode(element, true), element);													found= true;													break;												}											}										}									}									if (!found)										root.appendChild(document.importNode(list.item(0), true));									writeHistoryEntry(history, document, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));									addIndexEntry(index, descriptor, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));								}							} catch (ParserConfigurationException exception) {								throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));							} catch (IOException exception) {								throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));							} catch (SAXException exception) {								throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));							} finally {								if (input != null) {									try {										input.close();									} catch (IOException exception) {										// Do nothing									}								}							}						} else {							try {								final Object result= transformDescriptor(descriptor, false);								if (result instanceof Node) {									writeHistoryEntry(history, (Node) result, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));									appendIndexEntry(index, descriptor, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));								}							} catch (IOException exception) {								throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));							}						}					}				}			}		} finally {			monitor.done();		}	}