I hope that title makes some sort of sense…
I have to preface this by mentioning that I’m not even certain I’ve found the bug in my class, but I *think* I’ve found it.
I’ve got two Maps that will have different ways of using the contents of an single ArrayList
newArrayList = Map1.get(keyToOldArrayList);
as a way of moving the data over. However, when I alter Map2, oldArrayList in Map1 gets altered as well. This is no big surprise, but how do I avoid it? I tried:
but that has the same result (or so it seems).
BTW, if this is the way I’m supposed to copy the data, in order to make a copy I can manipulate without messing with Map1, then I’ve got another problem somewhere else and I’ll leave everybody alone. I just can’t see anywhere else that could be giving me this sort of trouble.
On 07-02-09, at 1939, jbmaxwell wrote:
> I hope that title makes some sort of sense…
yep, you need to deep copy.
hope that helps.
Cool, I’ll look into that. It’s amazing how far you can go and not ever have to do something so simple… weird.
Brilliant. That was the problem. Fixed!
C74 RSS Feed | © Copyright Cycling '74