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
}
	
	public static Type getTypeFromTypeBinding(AST ast, ITypeBinding binding) {
		if (binding.isArray()) {
			int dim= binding.getDimensions();
			return ast.newArrayType(getTypeFromTypeBinding(ast, binding.getElementType()), dim);
		} else if (binding.isPrimitive()) {
			String name= binding.getName();
			return ast.newPrimitiveType(PrimitiveType.toCode(name));
		} else if (!binding.isNullType() && !binding.isAnonymous()) {
			return ast.newSimpleType(ast.newSimpleName(binding.getName()));
		}
		return null;
	}
	
	public static Expression getInitExpression(Type type, int extraDimensions) {
		if (extraDimensions == 0 && type.isPrimitiveType()) {
			PrimitiveType primitiveType= (PrimitiveType) type;
			if (primitiveType.getPrimitiveTypeCode() == PrimitiveType.BOOLEAN) {
				return type.getAST().newBooleanLiteral(false);
			} else if (primitiveType.getPrimitiveTypeCode() == PrimitiveType.VOID) {
				return null;				
			} else {
				return type.getAST().newNumberLiteral("0");
			}
		}
		return type.getAST().newNullLiteral();
	}
	
	private static class NodeFoundException extends RuntimeException {