Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6693509
Votes 0
Synopsis Deep Cloning for Map
Category java:classes_util
Reported Against
Release Fixed
State 1-Dispatched, request for enhancement
Priority: 5-Very Low
Related Bugs
Submit Date 24-APR-2008
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
Work Around
N/A
Evaluation
N/A
Comments
  
  Include a link with my name & email   

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