aucd29 / cloning

Automatically exported from code.google.com/p/cloning
Other
0 stars 0 forks source link

Callback for "should Clone" check #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Support for a callback that can provide a decision on whether an object should 
be cloned or not.

The callback would take the object to clone and return a Boolean:
* true == the object should be cloned
* false == the object should be returned as is
* null == null should be returned instead of cloning or returning the object as 
is

The callback should likely be added in cloneInternal(), after the bulk of the 
should or should not clone decisions are made, such as right before the calls 
to fastClone().

Original issue reported on code.google.com by jklap...@gmail.com on 22 May 2014 at 4:58

GoogleCodeExporter commented 9 years ago
Thinking about this more-- I believe the callback should be after the fast 
clone happens (which also returns) as a callback would not likely change the 
fast clone decision.

Original comment by jklap...@gmail.com on 23 May 2014 at 2:31