I pass org.codehaus.jettison.json.JSONArray as an argument to a method and I update (add/remove elements from the array) it in the method.
But the changes are not reflecting in the caller. From the source code, the class doesn't seem to Immutable. I am doing something as below in terms of code.
String jsonArrayAsString;
JSONArray ja = new JSONArray(jsonArrayAsString)
myMethod(ja);
// ja here remains unchanged
public void myMethod(JSONArray jsonArray){
JSONArray ja1 = JSONArray();
jsonArray = ja1;
}