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/ASTResolving.java
}   	
    	return null;
    }
    
   	private static ITypeBinding guessVariableType(List fragments) {
		for (Iterator iter= fragments.iterator(); iter.hasNext();) {
			VariableDeclarationFragment frag= (VariableDeclarationFragment) iter.next();
			if (frag.getInitializer() != null) {
				return frag.getInitializer().resolveTypeBinding();
			}
		}
		return null;
	} 
	
	
	public static MethodDeclaration findParentMethodDeclaration(ASTNode node) {
		while ((node != null) && (node.getNodeType() != ASTNode.METHOD_DECLARATION)) {
			node= node.getParent();
		}
		return (MethodDeclaration) node;
	}
	
	public static BodyDeclaration findParentBodyDeclaration(ASTNode node) {
		while ((node != null) && (!(node instanceof BodyDeclaration))) {
			node= node.getParent();
		}
		return (BodyDeclaration) node;
	}
	
	public static CompilationUnit findParentCompilationUnit(ASTNode node) {