Questions tagged [cloning]

Cloning refers to the making of an exact copy (deep copy) of any kind of object. It is the opposite of shallow copying, in which a reference to particular object is copied, not the object itself.

Cloning refers to the making of an exact copy (deep copy) of any kind of object. It is the opposite of shallow copying, in which a reference to particular object is copied, not the object itself.

377 questions
3
votes
1 answer

NoClassDefFoundError when using objenesis on Android

I'm developing an android app which use the com.rits.cloning and org.objenesis.* libs to deep clone object. The purpose is to add same object to my tree structure class twice or more without worrying that the original object is referencing to the…
hanzo765
  • 106
  • 1
  • 8
3
votes
1 answer

Java: Serialization performance for deep copy?

I need to deep-copy Java objects for one of my projects; and I was wondering if it's okay to use Serialization for this. The objects are fairly small (< 1kb each), total #objects per copy would be < 500, and the copy routine will be invoked a few…
shrini1000
  • 7,038
  • 12
  • 59
  • 99
3
votes
2 answers

PHP - clone an object that contains references to itself?

What is the best way to create a clone of a complex PHP object that includes many references to itself, so that the new object's references point to its own methods and properties, not those of the original object? I understand from the manual that…
user56reinstatemonica8
  • 32,576
  • 21
  • 101
  • 125
2
votes
1 answer

C++ synchronization and exception handling in cross threads

I am using boost library for threading and synchronization in my application. First of all I must say exceptions within threads on synchronization is compilitey new thing for me. In any case below is the pseudo code what I want to achieve. I want…
Lauri
  • 73
  • 8
2
votes
1 answer

Copying objects in java

I want to perform a deep copy on an object, does the clone function work to that extent, or do I have to create a function to physically copy it, and return a pointer to it? That is, I want Board tempBoard = board.copy(); This would copy the board…
SNpn
  • 2,157
  • 8
  • 36
  • 53
2
votes
1 answer

Copying objects in js (need guidance on pass by reference from docs)

I looked in the js docs and while studying the doc it mentioned in object.assign() If the source value is a reference to an object, it only copies the reference value. In my below snippet, one alters the original object and the other doesn't var…
Bilal Malik
  • 23
  • 1
  • 9
2
votes
1 answer

Connection reset by "IP" port 22 and client_loop: send disconnect: Broken pipe on cloning a repo from bitbucket

When I try to clone a repo from bitucket with my WiFi connected I receive two response on my terminal (Ubuntu 20.04.2 LTS x86_64) on alternate clone request : 1st request : Connection reset by "IP" port 22 fatal: Could not read from remote…
Jayant Sharma
  • 87
  • 1
  • 7
2
votes
1 answer

What happens to Strings when object is cloned in Java?

By default Java does Shallow Cloning, if an object is cloned and it has a String like this String s = new String("Hi"); then the cloned object will point to a new String object or it will have a reference to the previous object? The question here is…
Wilfred Almeida
  • 601
  • 8
  • 15
2
votes
1 answer

Inkscape: How to create a tiled clones using shift in millimeters, not percent

I'm trying to create a triangular grid in Inkscape. I'm going to create a slanted line then clone it along a direction to obtain a fence, then clone the fence at 60 and 120 degrees to obtain a grid at, for example, 5-mm steps. The problem is that…
mbaitoff
  • 8,831
  • 4
  • 24
  • 32
2
votes
1 answer

Managing foreign keys when using pg_restore with multiple dumps

I have a bit of a weird issue. We were trying to create a database baseline for our local environment that has very specific data pre-seeded into it. Our hopes were to make sure that everyone was operating with the same data, making collaboration…
John Baker
  • 99
  • 9
2
votes
1 answer

C# Cloning an ICloneable object containing List

I have an issue while using my ICloneable class when it comes to cloning lists: class MetroBoards : ICloneable { public int Iteration; public List MetroPieces = new List(); public List MetroPiecesDefinition = new…
2
votes
1 answer

How to clone a specific tag version using Mercurial?

I'm trying to clone a specific tag from an existing repository from Kiln using Mercurial. I have tried commands like: hg clone --verbose [Source URL] -b [tag number] [Dest] hg clone --verbose [Source URL] -r [tag number] [Dest] hg clone --verbose…
kavya M
  • 31
  • 1
  • 2
2
votes
3 answers

Is it possible to shallow copy a singleton class object?

Using the clone method, can we get many instances of a class which has been made singleton ? Also, is it necessary to write "implements Cloneable" because I learnt that all objects extend from Object class and hence the child object calling…
Prabhat Gaur
  • 146
  • 1
  • 10
2
votes
3 answers

How to clone a record (server side) in Dynamics crm 2016?

I am using crm 2016 and I need to clone a record using plugin, after googling I found out that I need to use Microsoft.Xrm.Client that hold the clone() function - which is not in 2016 SDK because of MS reorganization.This lib is in 2015 SDK. My…
Damkulul
  • 1,406
  • 2
  • 25
  • 59
2
votes
2 answers

Javascript: member method error when cloning an instance with Object.assign

I'm a JS newbie and I've been playing around the object creation and cloning with create () and assign () when I encountered the following error: let Student = { first_name : '', last_name : '', major : '', IsNotSet : function () { …
R34
  • 59
  • 6