This method generates a nested hashmap for the parameters table
@param {Object} objArray the Array structure containing the parameters
172245
function generateNestedMap(objArray) {
    let mainMap = new Map();
    objArray.forEach((obj) => {
        let params = obj.name.split('.');
        let i = 0;
        let k = mainMap;

        while (k.has(params[i])) {
            k = k.get(params[i]);
            i++;
        }
        let kk = new Map();
        kk.set('value', obj.description.replace(/(\r\n|\n|\r)/gm, ' '));
        kk.set('type', obj.type.names.join('\n\n').replace(/\./gi, ''));
        k.set(params[i], kk);
    });
    return mainMap;
}
71160
function (map, array) {
                if (map == null)
                    return;
                for (var i in map) {
                    var item = map[i];
                    var key = item.key;
                    if (map == this._objectKeys) {
                        key[this._metaDataName] = null;
                        delete item.key[this._metaDataName];
                    }
                    while (item) {
                        array.push(item.value);
                        item.value = null;
                        item.key = null;
                        var next = item.next;
                        item.next = null;
                        item = next;
                    }
                    map[i] = null;
                    delete map[i];
                }
            }
1320532
private Collection<HColumn<String, byte[]>> createColumnSet(Object obj) {
    Map<String, HColumn<String, byte[]>> map = createColumnMap(obj);
    if (null != map) {
      return map.values();
    } else {
      return null;
    }
  }
502301
function stepsObjectToArray (stepsObject) {
  return Object.keys(stepsObject).map(stepCode => {
    return {
      ...stepsObject[stepCode],
      code: stepCode,
      label: getText('steps', `${stepCode}Label`),
      labelPending: getText('steps', `${stepCode}LabelPending`)
    };
  });
}
592892
function indexProperties(obj) {
	if (!obj)
		return;
	if (obj.propertyMap)
		return;
	obj.propertyMap = new Map;
	obj.properties.forEach(function(prty) {
		obj.propertyMap.put(prty.name, prty);
	})
	if (!obj.prototype)
		return;
	var parent = lookupObject(obj.prototype.key);
	indexProperties(parent)
	parent.propertyMap.forEach(function(name,prty) {
		if (!obj.propertyMap.has(name)) {
			obj.propertyMap.put(name,prty);
		}
	})
}
246991
function(thisObj, data) {
    data = data || (thisObj = thisObj || {});
    
    //the 'data' argument can come in two flavours - array or non-array. Normalise it
    //here so that it always looks like an array.
    if (data.constructor.toString().indexOf("Array") == -1) {
      data = [data];
    }
    
    with(this) {
      for (var i=0; i < data.length; i++) {
        eval("(" + this.tpl.toString() + ").call(thisObj, data[i], i)");
      };
    }
    
    var roots  = this.getRoots(),
        output = "";
    
    for (var i=0; i < roots.length; i++) {
      output += roots[i].render();
    };
    
    return output;
  }
741069
function map(obj, callback) {
  var result = {};
  for (var key in obj) {
    if (Object.prototype.hasOwnProperty.call(obj, key)) {
      if (typeof callback === 'function') {
        result[key] = callback.call(obj, obj[key], key, obj);
      }
    }
  }
  return result;
}
146851
static String generateParamList(JsDoc jsDoc) {
    ImmutableList<JsDoc.Param> params = jsDoc.params();
    List<String> functionParameters = new ArrayList<>();
    for (JsDoc.Param param : params) {
      if ("param".equals(param.annotationType())) {
        functionParameters.add(param.paramTypeName());
      }
    }
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < functionParameters.size(); i++) {
      sb.append(functionParameters.get(i));
      if (i + 1 < functionParameters.size()) {
        sb.append(", ");
      }
    }
    return sb.toString();
  }
935501
private static function _arrayToObjectDeeply($array,$obj,$classMap=[],$fieldAccess=true,$currentPrefix="")
    {
        $prefix=$currentPrefix;
        if(!empty($prefix)){
            $prefix.=".";
        }
        if(is_array($array) && is_object($obj)){
            $props=[];
            if($fieldAccess){
                $props=array_keys(get_object_vars($obj));
            }
            foreach ($array as $name => $value){
                $key=$prefix.$name;
                if(array_key_exists($key, $classMap)){
                    if(is_array($value)){
                        $map=$classMap[$key];
                        $class=$map[0];
                        $isArray=$map[1];

                        if($isArray && is_array($value)){
                            $objArray=[];
                            foreach ($value as $_name => $_value){
                                $_obj=new $class();
                                self::_arrayToObjectDeeply($_value, $_obj,$classMap,$fieldAccess,$key);
                                $objArray[$_name]=$_obj;
                            }
                            self::_setProperty($obj, $name, $objArray,$props);
                        }else{
                            $_obj=new $class();
                            self::_arrayToObjectDeeply($value, $_obj,$classMap,$fieldAccess,$key);
                            self::_setProperty($obj, $name, $_obj,$props);
                        }
                    }
                }else{
                    self::_setProperty($obj, $name, $value,$props);
                }
            }
        }
    }
1274412
function mapObjects(arr, idKey) {
  var r = {};
  var len = arr.length;

  for (var i = 0; i < len; i++) {
    var item = arr[i];
    var id = isFunction(idKey) ? idKey(item, i) : item[idKey];
    r[id] = item;
  }

  return r;
}
366484
function buildSchema(jsObj, key) {
  if (jsObj === undefined) return null;

  var type = typeOf(jsObj);
  switch (type) {
    case "array":
      {
        let schema = {
          type: "list",
          detail: buildSchema(jsObj[0])
        };
        key && (schema.name = key);
        return schema;
      }
    case "object":
      {
        let schema = {
          type: "map",
          detail: []
        };
        key && (schema.name = key);
        let keys = Object.keys(jsObj);
        for (var i in keys) {
          let key = keys[i];
          if (jsObj[key] !== undefined) {
            schema.detail.push(buildSchema(jsObj[key], key));
          }
        }
        return schema;
      }
    case "null":
    case "string":
    case "number":
    case "date":
    case "boolean":
      {
        let schema = {
          type: type
        };
        key && (schema.name = key);
        return schema;
      }
    default:
      throw Error("Unacceptable type : " + type);
  }
}
1219981
function(obj, callback) {
    if (angular.isArray(obj))
      return obj.map(callback)

    var ret = {}
    Object.keys(obj).forEach(function(key, val) {
      ret[key] = callback(obj[key], key)
    })
    return ret
  }
497400
public static Map<String, ValueCommand> createParameterMap(Object... params) {
        assert params.length % 2 == 0;
        Map<String, ValueCommand> ret = new HashMap<String, ValueCommand>();
        for (int i = 0; i < params.length; i = i + 2) {
            String param = params[i].toString();
            Value value = convertFromJava(params[i + 1]);
            ret.put(param, new LiteralCommand(value));
        }
        return ret;
    }
1086348
function (obj) {
    // sanity check
    if (!obj || typeof obj !== 'object') {
      return []
    }

    var results = []

    Object.keys(obj).forEach(function (name) {
      // nested values in query string
      if (typeof obj[name] === 'object') {
        obj[name].forEach(function (value) {
          results.push({
            name: name,
            value: value
          })
        })
        return
      }

      results.push({
        name: name,
        value: obj[name]
      })
    })

    return results
  }
1198507
public static String[] toStringArray(Object[] objArray) {
        int idx;
        int len = objArray.length;
        String[] strArray = new String[len];

        for (idx = 0; idx < len; idx++) {
            strArray[idx] = objArray[idx].toString();
        }

        return strArray;
    }
200664
private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
        List<AbstractPlanNode> planNodes = new ArrayList<>();
        int size = jArray.length();

        try {
            for (int i = 0; i < size; i++) {
                JSONObject jobj = jArray.getJSONObject(i);
                String nodeTypeStr = jobj.getString("PLAN_NODE_TYPE");
                PlanNodeType nodeType = PlanNodeType.get(nodeTypeStr);
                AbstractPlanNode apn = nodeType.getPlanNodeClass().newInstance();
                apn.loadFromJSONObject(jobj, db);
                planNodes.add(apn);
            }

            //link children and parents
            for (int i = 0; i < size; i++) {
                JSONObject jobj = jArray.getJSONObject(i);
                if (jobj.has("CHILDREN_IDS")) {
                    AbstractPlanNode parent = planNodes.get(i);
                    JSONArray children = jobj.getJSONArray("CHILDREN_IDS");
                    for (int j = 0; j < children.length(); j++) {
                        AbstractPlanNode child = getNodeofId(children.getInt(j), planNodes);
                        parent.addAndLinkChild(child);
                    }
                }
            }
            m_planNodesListMap.put(stmtId,  planNodes);
        }
        catch (JSONException | InstantiationException | IllegalAccessException e) {
            System.err.println(e);
            e.printStackTrace();
        }
    }
1150419
private static Map<String, Object> parseAlData(JSONArray dataArray) throws JSONException {
    HashMap<String, Object> al = new HashMap<String, Object>();
    for (int i = 0; i < dataArray.length(); i++) {
      JSONObject tag = dataArray.getJSONObject(i);
      String name = tag.getString("property");
      String[] nameComponents = name.split(":");
      if (!nameComponents[0].equals(META_TAG_PREFIX)) {
        continue;
      }
      Map<String, Object> root = al;
      for (int j = 1; j < nameComponents.length; j++) {
        @SuppressWarnings("unchecked")
        List<Map<String, Object>> children =
                (List<Map<String, Object>>) root.get(nameComponents[j]);
        if (children == null) {
          children = new ArrayList<Map<String, Object>>();
          root.put(nameComponents[j], children);
        }
        Map<String, Object> child = children.size() > 0 ? children.get(children.size() - 1) : null;
        if (child == null || j == nameComponents.length - 1) {
          child = new HashMap<String, Object>();
          children.add(child);
        }
        root = child;
      }
      if (tag.has("content")) {
        if (tag.isNull("content")) {
          root.put(KEY_AL_VALUE, null);
        } else {
          root.put(KEY_AL_VALUE, tag.getString("content"));
        }
      }
    }
    return al;
  }