final ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(CorrectionMessages.QuickAssistProcessor_create_fix_name, change, 1, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {
final ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(CorrectionMessages.QuickAssistProcessor_create_fix_name, change, 100, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {
	private static boolean getFixDeprecationProposals(final IInvocationContext context, final ASTNode node, final Collection resultingCollections) {		Name name;		if (node instanceof Name)			name= (Name) node;		else			return false;		final IBinding binding= name.resolveBinding();		if (binding == null || !binding.isDeprecated())			return false;		final CompilationUnit root= (CompilationUnit) ASTNodes.getParent(node, ASTNode.COMPILATION_UNIT);		if (root == null)			return false;		String fileName= null;		if (binding instanceof IVariableBinding)			fileName= DelegateFieldCreator.getRefactoringScriptName((IVariableBinding) binding);		else if (binding instanceof IMethodBinding) {			fileName= DelegateMethodCreator.getRefactoringScriptName((IMethodBinding) binding);		}		if (fileName == null)			return false;		final ICompilationUnit unit= context.getCompilationUnit();		if (unit == null || !unit.exists())			return false;		final IProject project= unit.getJavaProject().getProject();		final IFile file= project.getFolder(IDeprecationConstants.SCRIPT_FOLDER).getFile(fileName);		final ASTNode declaring= root.findDeclaringNode(binding);		if (declaring != null) {			if (resultingCollections == null)				return true;			RefactoringSessionDescriptor descriptor= null;			if (binding instanceof IVariableBinding) {				final IJavaElement element= binding.getJavaElement();				if (element != null) {					final InlineConstantRefactoring refactoring= new InlineConstantRefactoring((IField) element);					descriptor= refactoring.createDeprecationResolution();				}			} else if (binding instanceof IMethodBinding) {				final IJavaElement element= binding.getJavaElement();				if (element != null) {					final InlineMethodRefactoring refactoring= new InlineMethodRefactoring((IMethod) element);					descriptor= refactoring.createDeprecationResolution();				}			}			if (descriptor == null)				return false;			String script= null;			try {				final ByteArrayOutputStream stream= new ByteArrayOutputStream(1024);				RefactoringCore.getHistoryService().writeRefactoringSession(descriptor, stream, false);				script= stream.toString(IDeprecationConstants.SCRIPT_ENCODING);			} catch (CoreException exception) {				JavaPlugin.log(exception);			} catch (UnsupportedEncodingException exception) {				Assert.isTrue(false);			}			if (script == null)				return false;			final Change change= new CreateDeprecationScriptChange(file.getFullPath(), script, CorrectionMessages.QuickAssistProcessor_create_fix_name);			final ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(CorrectionMessages.QuickAssistProcessor_create_fix_name, change, 1, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {				public final String getAdditionalProposalInfo() {					return CorrectionMessages.QuickAssistProcessor_create_fix_info;				}			};			resultingCollections.add(proposal);			return true;		} else {			if (!file.exists())				return false;			if (resultingCollections == null)				return true;			final ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(CorrectionMessages.QuickAssistProcessor_fix_deprecation_name, null, 2, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {				private static final int SIZING_WIZARD_HEIGHT= 470;				private static final int SIZING_WIZARD_WIDTH= 490;				private RefactoringHistory fCachedHistory= null;				private RefactoringHistory getRefactoringHistory() {					if (fCachedHistory == null) {						InputStream stream= null;						try {							stream= new BufferedInputStream(file.getContents(true));							fCachedHistory= 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);								}							}						}					}					return fCachedHistory;				}				public final void apply(final IDocument document) {					final RefactoringHistory history= getRefactoringHistory();					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();				}				public final String getAdditionalProposalInfo() {					final RefactoringHistory history= getRefactoringHistory();					if (history == null || history.isEmpty())						return ""; //$NON-NLS-1$					final StringBuffer buffer= new StringBuffer(512);					HTMLPrinter.startBulletList(buffer);					final RefactoringDescriptorProxy[] proxies= history.getDescriptors();					for (int index= 0; index < proxies.length; index++) {						HTMLPrinter.addBullet(buffer, proxies[index].getDescription());					}					HTMLPrinter.endBulletList(buffer);					return Messages.format(CorrectionMessages.QuickAssistProcessor_fix_deprecation_info, buffer.toString());				}			};			resultingCollections.add(proposal);			return true;		}	}