RefactoringHistory history= null; InputStream stream= null; try { stream= new BufferedInputStream(file.getContents(true)); history= RefactoringCore.getHistoryService().readRefactoringHistory(stream, JavaRefactoringDescriptor.DEPRECATION_RESOLVING); } catch (CoreException exception) { JavaPlugin.log(exception); } finally { if (stream != null) { try { stream.close(); } catch (IOException exception) { JavaPlugin.log(exception); } } }
final RefactoringHistory history= getRefactoringHistory();
			public final void apply(final IDocument document) {				RefactoringHistory history= null;				InputStream stream= null;				try {					stream= new BufferedInputStream(file.getContents(true));					history= RefactoringCore.getHistoryService().readRefactoringHistory(stream, JavaRefactoringDescriptor.DEPRECATION_RESOLVING);				} catch (CoreException exception) {					JavaPlugin.log(exception);				} finally {					if (stream != null) {						try {							stream.close();						} catch (IOException exception) {							JavaPlugin.log(exception);						}					}				}				if (history == null || history.isEmpty())					return;				final FixDeprecationRefactoringWizard wizard= new FixDeprecationRefactoringWizard(history.getDescriptors().length > 1, context.getCompilationUnit(), node.getStartPosition(), node.getLength());				final WizardDialog dialog= new WizardDialog(JavaPlugin.getActiveWorkbenchShell(), wizard);				wizard.setRefactoringHistory(history);				dialog.create();				dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);				PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IJavaHelpContextIds.FIX_DEPRECATION_WIZARD_PAGE);				dialog.getShell().getDisplay().asyncExec(new Runnable() {					public final void run() {						dialog.showPage(wizard.getNextPage(wizard.getStartingPage()));					}				});				dialog.open();			}