have you noticed that if you put a JSONObject into another JSONObject with put(), the container JSONObject won't store the reference to the first JSONObject, but a new JSONObject?
An example:
JSONObject jtmp1 = new JSONObject();
JSONObject jtmp2 = new JSONObject();
jtmp1.put("test", jtmp2);
System.out.println(System.identityHashCode(jtmp2));
System.out.println(System.identityHashCode(jtmp1.getJSONObject("test")));
The output from the 2 prints is different, therefore jtmp2 is not directly stored in jtmp1.
Is this the normal behavior? Are there any workarounds to it? I'm quite new to JAVA but in my opinion this is not the behavior one would expect.