Bug 80364 [Quick Assist] "Assign parameter to field" does not work for existing field
In this small example, there does not occur the quick-fix to "Assign parameter to new field": public class Foo { private final Bar bar; public Foo(Bar bar) { } } Even worse: when I remove the final from the variable declaration, invoking the quick-fix creates a new variable bar2 instead of reusing the existing one.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java
if (tryStatement == null || tryStatement.getFinally() != null) {
			return false;
		}
		Statement statement= ASTResolving.findParentStatement(node);
		if (tryStatement != statement && tryStatement.getBody() != statement) {
			return false; 
		}
		if (resultingCollections == null) {
			return true;
		}
		AST ast= tryStatement.getAST();
		ASTRewrite rewrite= ASTRewrite.create(ast);
		Block finallyBody= ast.newBlock();
		rewrite.set(tryStatement, TryStatement.FINALLY_PROPERTY, finallyBody, null);
		String label= CorrectionMessages.QuickAssistProcessor_addfinallyblock_description;
		Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_ADD);
		ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 1, image);
		resultingCollections.add(proposal);
		return true;
	}
	private static boolean getAddElseProposals(IInvocationContext context, ASTNode node, Collection resultingCollections) {
		Statement statement= ASTResolving.findParentStatement(node);
		if (!(statement instanceof IfStatement)) {
			return false;
		}
		IfStatement ifStatement= (IfStatement) statement;
		if (ifStatement.getElseStatement() != null) {
			return false;
		}
		if (resultingCollections == null) {