MCPcopy Create free account
hub / github.com/cmu-db/benchbase / put

Method put

src/main/java/com/oltpbenchmark/util/JSONUtil.java:89–102  ·  view source on GitHub ↗

changes the value of JSONObject.map to a LinkedHashMap in order to maintain order of keys. See Also: https://stackoverflow.com/a/62476486

(String key, Object value)

Source from the content-addressed store, hash-verified

87 * keys. See Also: https://stackoverflow.com/a/62476486
88 */
89 @Override
90 public JSONObject put(String key, Object value) throws JSONException {
91 try {
92 Field map = JSONObject.class.getDeclaredField("map");
93 map.setAccessible(true);
94 Object mapValue = map.get(this);
95 if (!(mapValue instanceof LinkedHashMap)) {
96 map.set(this, new LinkedHashMap<>());
97 }
98 } catch (NoSuchFieldException | IllegalAccessException e) {
99 throw new RuntimeException(e);
100 }
101 return super.put(key, value);
102 }
103 }));
104 } catch (RuntimeException ex) {
105 throw ex;

Callers 15

setUpMethod · 0.45
testCheckClientMethod · 0.45
testCompareToMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45
testMaxCountValuesMethod · 0.45
testZeroEntriesMethod · 0.45
testGetGreatestMethod · 0.45
toMapMethod · 0.45
runMethod · 0.45
mainMethod · 0.45

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by 9

setUpMethod · 0.36
testCheckClientMethod · 0.36
testCompareToMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36
testMaxCountValuesMethod · 0.36
testZeroEntriesMethod · 0.36
testGetGreatestMethod · 0.36