final RefactoringDescriptorProxy[] proxies= RefactoringHistoryService.getInstance().readRefactoringDescriptorProxies(stream, RefactoringDescriptor.NONE);
final RefactoringDescriptorProxy[] proxies= RefactoringHistoryService.getInstance().readRefactoringDescriptorProxies(stream, RefactoringDescriptor.MULTI_CHANGE);
	private RefactoringHistory getRefactoringHistory(final IDiff[] diffs, final IProgressMonitor monitor) {		try {			monitor.beginTask(RefactoringUIMessages.RefactoringModelMerger_retrieving_refactorings, diffs.length * 2);			final Collection existing= new ArrayList();			final Set incoming= new HashSet();			for (int index= 0; index < diffs.length; index++) {				final IDiff diff= diffs[index];				if (diff instanceof IThreeWayDiff) {					final IThreeWayDiff threeWay= (IThreeWayDiff) diff;					final int direction= threeWay.getDirection();					if (direction == IThreeWayDiff.INCOMING || direction == IThreeWayDiff.CONFLICTING) {						final ITwoWayDiff remoteDiff= threeWay.getRemoteChange();						if (remoteDiff instanceof IResourceDiff) {							final IFileRevision remoteRevision= ((IResourceDiff) remoteDiff).getAfterState();							if (remoteRevision != null) {								final String name= remoteRevision.getName();								if (name.equalsIgnoreCase(RefactoringHistoryService.NAME_INDEX_FILE)) {									final ITwoWayDiff localDiff= threeWay.getLocalChange();									if (localDiff instanceof IResourceDiff) {										final IFileRevision localRevision= ((IResourceDiff) localDiff).getAfterState();										IStorage storage= null;										try {											storage= localRevision.getStorage(new SubProgressMonitor(monitor, 1));										} catch (CoreException exception) {											RefactoringUIPlugin.log(exception);										}										if (storage != null) {											InputStream stream= null;											try {												stream= storage.getContents();												final RefactoringDescriptorProxy[] proxies= RefactoringHistoryService.getInstance().readRefactoringDescriptorProxies(stream, RefactoringDescriptor.NONE);												for (int offset= 0; offset < proxies.length; offset++)													existing.add(proxies[offset]);											} catch (CoreException exception) {												RefactoringUIPlugin.log(exception);											} finally {												if (stream != null) {													try {														stream.close();													} catch (IOException exception) {														// Do nothing													}												}											}										}									}								} else if (name.equalsIgnoreCase(RefactoringHistoryService.NAME_HISTORY_FILE)) {									IStorage storage= null;									try {										storage= remoteRevision.getStorage(new SubProgressMonitor(monitor, 1));									} catch (CoreException exception) {										RefactoringUIPlugin.log(exception);									}									if (storage != null) {										InputStream stream= null;										try {											stream= storage.getContents();											final RefactoringHistory history= RefactoringHistoryService.getInstance().readRefactoringHistory(stream, RefactoringDescriptor.MULTI_CHANGE);											if (history != null && !history.isEmpty()) {												final RefactoringDescriptorProxy[] proxies= history.getDescriptors();												for (int offset= 0; offset < proxies.length; offset++)													incoming.add(proxies[offset]);											}										} catch (CoreException exception) {											RefactoringUIPlugin.log(exception);										} finally {											if (stream != null) {												try {													stream.close();												} catch (IOException exception) {													// Do nothing												}											}										}									}								}							}						}					}				}			}			incoming.removeAll(existing);			final RefactoringDescriptorProxy[] proxies= new RefactoringDescriptorProxy[incoming.size()];			incoming.toArray(proxies);			return new RefactoringHistoryImplementation(proxies);		} finally {			monitor.done();		}	}