code: private static SuggestedFix getFixForEarlyReference(JSError error, AbstractCompiler compiler) {
      Matcher m = EARLY_REF.matcher(error.description);
      if (m.matches()) {
        String name = m.group(1);
        Node stmt = NodeUtil.getEnclosingStatement(error.node);
        return new SuggestedFix.Builder()
            .attachMatchedNodeInfo(error.node, compiler)
            .insertBefore(stmt, "var " + name + ";\n")
            .build();
      }
      return null;
    }
docs: This fix is not ideal. It trades one warning (JSC_REFERENCE_BEFORE_DECLARE) for another
  (JSC_REDECLARED_VARIABLE). But after running the fixer once, you can then run it again and
  #getFixForRedeclaration will take care of the JSC_REDECLARED_VARIABLE warning.