17 Jul 09:08
[groovy-user] inconsistent behavior with clone() method on a map?
From: josepe <jmhurtado@...>
Subject: [groovy-user] inconsistent behavior with clone() method on a map?
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-17 07:11:49 GMT
Subject: [groovy-user] inconsistent behavior with clone() method on a map?
Newsgroups: gmane.comp.lang.groovy.user
Date: 2008-07-17 07:11:49 GMT
Cloning a map object makes deep copies of some but not other fields dazed=[buggy:[],ok:0] //clone and modify copy confused = dazed.clone() confused.buggy << "intruder" confused.ok +=1 //check integrity of original assert dazed.ok == 0 // ok assert dazed.buggy == [] // oops! -- -- View this message in context: http://www.nabble.com/inconsistent-behavior-with-clone%28%29-method-on-a-map--tp18502809p18502809.html Sent from the groovy - user mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
RSS Feed