cpp: integrate Init() into the StartupOptions constructor

This patch integrates the code of Init() function into
StartupOptions's constuctor and thus fixing the TODO
in startup_options.cc.

--
Change-Id: Ic041306387f5ef82fa80d8511c3e9b7be706754a
Reviewed-on: https://bazel-review.googlesource.com/#/c/6332/2
MOS_MIGRATED_REVID=134759417
diff --git a/src/main/cpp/startup_options.cc b/src/main/cpp/startup_options.cc
index 09b8eab..3f93b30 100644
--- a/src/main/cpp/startup_options.cc
+++ b/src/main/cpp/startup_options.cc
@@ -33,51 +33,41 @@
 
 using std::vector;
 
-StartupOptions::StartupOptions() :
-  StartupOptions("Bazel") {
-  Init();
-}
+StartupOptions::StartupOptions() : StartupOptions("Bazel") {}
 
-StartupOptions::StartupOptions(const string& product_name) :
-  product_name(product_name) {
-  Init();
-}
-
-StartupOptions::~StartupOptions() {
-}
-
-// TODO(jmmv): Integrate Init into the StartupOptions constructor.
-void StartupOptions::Init() {
+StartupOptions::StartupOptions(const string &product_name)
+    : product_name(product_name),
+      deep_execroot(true),
+      block_for_lock(true),
+      host_jvm_debug(false),
+      batch(false),
+      batch_cpu_scheduling(false),
+      io_nice_level(-1),
+      oom_more_eagerly(false),
+      oom_more_eagerly_threshold(100),
+      write_command_log(true),
+      watchfs(false),
+      allow_configurable_attributes(false),
+      fatal_event_bus_exceptions(false),
+      command_port(0),
+      invocation_policy(NULL) {
   bool testing = getenv("TEST_TMPDIR") != NULL;
   if (testing) {
     output_root = MakeAbsolute(getenv("TEST_TMPDIR"));
   } else {
-      output_root = WorkspaceLayout::GetOutputRoot();
+    output_root = WorkspaceLayout::GetOutputRoot();
   }
 
   string product_name_lower = product_name;
   blaze_util::ToLower(&product_name_lower);
   output_user_root = blaze_util::JoinPath(
       output_root, "_" + product_name_lower + "_" + GetUserName());
-  deep_execroot = true;
-  block_for_lock = true;
-  host_jvm_debug = false;
-  host_javabase = "";
-  batch = false;
-  batch_cpu_scheduling = false;
-  allow_configurable_attributes = false;
-  fatal_event_bus_exceptions = false;
-  io_nice_level = -1;
   // 3 hours (but only 15 seconds if used within a test)
   max_idle_secs = testing ? 15 : (3 * 3600);
-  oom_more_eagerly_threshold = 100;
-  command_port = 0;
-  oom_more_eagerly = false;
-  write_command_log = true;
-  watchfs = false;
-  invocation_policy = NULL;
 }
 
+StartupOptions::~StartupOptions() {}
+
 void StartupOptions::AddExtraOptions(vector<string> *result) const {}
 
 blaze_exit_code::ExitCode StartupOptions::ProcessArg(
diff --git a/src/main/cpp/startup_options.h b/src/main/cpp/startup_options.h
index 523523a..b7b4c3f 100644
--- a/src/main/cpp/startup_options.h
+++ b/src/main/cpp/startup_options.h
@@ -207,10 +207,8 @@
 
  private:
   string host_javabase;
-
-  // Sets default values for members.
-  void Init();
 };
 
 }  // namespace blaze
+
 #endif  // BAZEL_SRC_MAIN_CPP_STARTUP_OPTIONS_H_