package tachyon.conf;

import org.apache.log4j.Logger;

import tachyon.CommonUtils;

/**
 * Utils for tachyon.conf package.
 */
class Utils {
  private static final Logger LOG = Logger.getLogger("");

  public static String getProperty(String property) {
    String ret = System.getProperty(property);
    if (ret == null) {
      CommonUtils.illegalArgumentException(property + " is not configured.");
    } else {
      LOG.debug(property + " : " + ret);
    }
    return ret;
  }

  public static String getProperty(String property, String defaultValue) {
    String ret = System.getProperty(property);
    String msg = "";
    if (ret == null) {
      ret = defaultValue;
      msg = " uses the default value";
    }
    LOG.debug(property + msg + " : " + ret);
    return ret;
  }

  public static int getIntProperty(String property) {
    return Integer.parseInt(getProperty(property));
  }

  public static int getIntProperty(String property, int defaultValue) {
    return Integer.parseInt(getProperty(property, defaultValue + ""));
  }

  public static boolean getBooleanProperty(String property) {
    return Boolean.parseBoolean(getProperty(property));
  }

  public static boolean getBooleanProperty(String property, boolean defaultValue) {
    return Boolean.parseBoolean(getProperty(property, defaultValue + ""));
  }
}

@@ -849,32 +849,31 @@
 urn Integer.
-parseInt
+valueOf
 (getProperty
@@ -985,16 +985,15 @@
 ger.
-parseInt
+valueOf
 (get
@@ -1114,36 +1114,31 @@
 urn Boolean.
-parseBoolean
+valueOf
 (getProperty
@@ -1262,20 +1262,15 @@
 ean.
-parseBoolean
+valueOf
 (get

use valueOf instead of parse