|
Description
|
A DESCRIPTION OF THE REQUEST :
Map is not able to do the deep cloning, while calling the clone() method on it.. It just uses the reference copy, not creating the another cloneed customer .
JUSTIFICATION :
This feature should be there because, if i need another map very similar to the same map and i want to retain the first map as static and changing the cloned map, the actual map should not be change.
To do this, clone() method in the collection customer need to be changed to perfrom deep cloning insteed of just copying the same references. Either modify clone() method or need to introduce another method to do this stuffs.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The Actual map should not changed, when ever i am changing the cloned map.
ACTUAL -
The Actual map is also getting changed, when ever i am changing the cloned map.
Posted Date : 2008-04-24 15:35:22.0
|
|
Comments
|
Submitted On 27-APR-2008
Pjaiswal
Need to resolve all collection APIs clone()
Submitted On 03-OCT-2008
javagourou
I don't want and don't need deep cloning. If I want to clone a collection, I don't want to clone its menbers.
May be a deepClone() method can help.
Note if you change the clone, the original collection is not changed.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|