if (output != null) { final Transformer transformer= TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, IRefactoringSerializationConstants.OUTPUT_INDENT); transformer.setOutputProperty(OutputKeys.METHOD, IRefactoringSerializationConstants.OUTPUT_METHOD); transformer.setOutputProperty(OutputKeys.ENCODING, IRefactoringSerializationConstants.OUTPUT_ENCODING); try { transformer.transform(new DOMSource(node), new StreamResult(output)); } finally { fCachedDocument= null; fCachedPath= null; fCachedDescriptor= null; fCachedStore= null; }
final Transformer transformer= TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, IRefactoringSerializationConstants.OUTPUT_INDENT); transformer.setOutputProperty(OutputKeys.METHOD, IRefactoringSerializationConstants.OUTPUT_METHOD); transformer.setOutputProperty(OutputKeys.ENCODING, IRefactoringSerializationConstants.OUTPUT_ENCODING); try { transformer.transform(new DOMSource(node), new StreamResult(output)); } finally { fCachedDocument= null; fCachedPath= null; fCachedDescriptor= null; fCachedStore= null;
	private void addHistoryEntry(final IFileStore file, final Node node, final IProgressMonitor monitor) throws CoreException, IOException {		OutputStream output= null;		try {			monitor.beginTask(RefactoringCoreMessages.RefactoringHistoryService_updating_history, 2);			try {				file.getParent().mkdir(EFS.NONE, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));				output= new BufferedOutputStream(file.openOutputStream(EFS.NONE, new SubProgressMonitor(monitor, 1, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)));				if (output != null) {					final Transformer transformer= TransformerFactory.newInstance().newTransformer();					transformer.setOutputProperty(OutputKeys.INDENT, IRefactoringSerializationConstants.OUTPUT_INDENT);					transformer.setOutputProperty(OutputKeys.METHOD, IRefactoringSerializationConstants.OUTPUT_METHOD);					transformer.setOutputProperty(OutputKeys.ENCODING, IRefactoringSerializationConstants.OUTPUT_ENCODING);					try {						transformer.transform(new DOMSource(node), new StreamResult(output));					} finally {						fCachedDocument= null;						fCachedPath= null;						fCachedDescriptor= null;						fCachedStore= null;					}				}			} catch (TransformerConfigurationException exception) {				throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));			} catch (TransformerFactoryConfigurationError exception) {				throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), 0, exception.getLocalizedMessage(), null));			} catch (TransformerException exception) {				final Throwable throwable= exception.getException();				if (throwable instanceof IOException)					throw (IOException) throwable;				RefactoringCorePlugin.log(exception);			} finally {				if (output != null) {					try {						output.close();					} catch (IOException exception) {						// Do nothing					}				}			}		} finally {			monitor.done();		}	}