code: public double optDouble(String key, double defaultValue) {
          Number val = this.optNumber(key);
          if (val == null) {
              return defaultValue;
          }
          final double doubleValue = val.doubleValue();
          // if (Double.isNaN(doubleValue) || Double.isInfinite(doubleValue)) {
          // return defaultValue;
          // }
          return doubleValue;
      }
docs: Get an optional double associated with a key, or the defaultValue if
  there is no such key or if its value is not a number. If the value is a
  string, an attempt will be made to evaluate it as a number.
  
  @param key
  A key string.
  @param defaultValue
  The default.
  @return An object which is the value.