I have a Map object whose values are constantly changing every time the map is updated. They keys are always the same, but the values change. Every time I change the Map object, I add it to an ArrayList. I can see that the values in the map are different each time the new map is added to the ArrayList, but when the ArrayList finishes being updated and is ready to be read from, all the Map's in it are the same.
Can anyone think of why this might be?
This is basically all that is happening...UpdateLog gets called with a new Map about 20 times and each dataMap1 object is different. It is added to the ArrayList. When I debug, I can see dataMap1 values are different each time. But when it is finished, every dataMap1 object in mapLog is the same!!
public void UpdateLog(final Map<String,String> dataMap1)
{
mapLog.add(dataMap1);
}