if (elements.length % 2 == 1) { throw new IllegalArgumentException("map() requires an even number of arguments"); Map m = map(); for (int ix = 0; ix < elements.length;) { m.put(elements[ix++], elements[ix++]); return m; ...
if (keyvals == null) { return new HashMap<>(); } else if (keyvals.length % 2 != 0) { throw new IllegalArgumentException("Map must have an even number of elements"); } else { Map<K, V> m = new HashMap<>(keyvals.length / 2); for (int i = 0; i < keyvals.length; i += 2) { m.put((K) keyvals[i], (V) keyvals[i + 1]); ...
Map map = new HashMap(); for (int i = 0; i < mapValues.length; i = i + 2) { map.put(mapValues[i], mapValues[i + 1]); return map;
if (objects.length % 2 != 0) { throw new RuntimeException("bad argument list " + objects.length + ": " + Arrays.toString(objects)); HashMap<String, Object> m = new HashMap<>(); for (int i = 0; i < objects.length; i += 2) { m.put((String) objects[i], objects[i + 1]); return m; ...
HashMap map = new HashMap(); Object key = null; for (final Object object : objects) { if (key == null) { key = object; } else { map.put(key, object); key = null; ...
return genericMap(objects);
if (objs.length % 2 != 0) { throw new IllegalArgumentException("Input map should contain even count of arguments."); Map<String, Object> map = new LinkedHashMap<>(); for (int i = 0; i < objs.length; i += 2) { map.put((String) objs[i], objs[i + 1]); return map; ...
Map result = new HashMap(); for (int i = 0; i < oo.length; i += 2) result.put(oo[i], oo[i + 1]); return result;
HashMap map = new HashMap(); for (int i = 0; i < params.length; i += 2) { map.put(params[i], params[i + 1]); return map;