Bug 25098 Quickfix for The local variable may not have been initialized.. [quick fix]
Often I write code like this: String name; try { name = "Good value"; int val = name.indexOf(42); } catch(Exception e) { throw new RuntimeException("Something went wrong with " + name); } The declaration of name is placed outside the try clause to provide access to it inside the catch. Here eclipse (as it should) complains that "The local variable name may not have been initialized". How about providing a QuickFix that assigned null to the uninitialized variable (e.g. "String name = null")
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
* </pre>
     * This correction changes <code>f</code> above to <code>File</code>.
     * 
	 * @param context
	 * @param proposals
	 */
	public static void addInstanceAccessToStaticProposals(ICorrectionContext context, List proposals) throws CoreException {
		ICompilationUnit cu= context.getCompilationUnit();
		CompilationUnit astRoot= context.getASTRoot();
		ASTNode selectedNode= context.getCoveredNode();
		if (selectedNode == null) {
			return;
		}
		Expression qualifier= null;
		IBinding accessBinding= null;
		
        if (selectedNode instanceof QualifiedName) {
        	QualifiedName name= (QualifiedName) selectedNode; 
            qualifier= name.getQualifier();
        	accessBinding= name.resolveBinding();
        } else if (selectedNode instanceof SimpleName) {
        	ASTNode parent= selectedNode.getParent();
        	if (parent instanceof FieldAccess) {
        		FieldAccess fieldAccess= (FieldAccess) parent;
        		qualifier= fieldAccess.getExpression();
        		accessBinding= fieldAccess.getName().resolveBinding();
        	}
        } else if (selectedNode instanceof MethodInvocation) {
        	MethodInvocation methodInvocation= (MethodInvocation) selectedNode;
        	qualifier= methodInvocation.getExpression();