File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -90,22 +90,9 @@ of this software and associated documentation files (the "Software"), to deal
90
90
* </ul>
91
91
*
92
92
* @author JSON.org
93
- * @version 2013-04-18
93
+ * @version 2013-06-17
94
94
*/
95
95
public class JSONObject {
96
- /**
97
- * The maximum number of keys in the key pool.
98
- */
99
- private static final int keyPoolSize = 100 ;
100
-
101
- /**
102
- * Key pooling is like string interning, but without permanently tying up
103
- * memory. To help conserve memory, storage of duplicated key strings in
104
- * JSONObjects will be avoided by using a key pool to manage unique key
105
- * string objects. This is used by JSONObject.put(string, object).
106
- */
107
- private static HashMap keyPool = new HashMap (keyPoolSize );
108
-
109
96
/**
110
97
* JSONObject.NULL is equivalent to the value that JavaScript calls null,
111
98
* whilst Java's null is equivalent to the value that JavaScript calls
@@ -1147,21 +1134,11 @@ public JSONObject put(String key, Map value) throws JSONException {
1147
1134
* If the value is non-finite number or if the key is null.
1148
1135
*/
1149
1136
public JSONObject put (String key , Object value ) throws JSONException {
1150
- String pooled ;
1151
1137
if (key == null ) {
1152
1138
throw new NullPointerException ("Null key." );
1153
1139
}
1154
1140
if (value != null ) {
1155
1141
testValidity (value );
1156
- pooled = (String ) keyPool .get (key );
1157
- if (pooled == null ) {
1158
- if (keyPool .size () >= keyPoolSize ) {
1159
- keyPool = new HashMap (keyPoolSize );
1160
- }
1161
- keyPool .put (key , key );
1162
- } else {
1163
- key = pooled ;
1164
- }
1165
1142
this .map .put (key , value );
1166
1143
} else {
1167
1144
this .remove (key );
You can’t perform that action at this time.
0 commit comments