question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why deepCopy is not public?

See original GitHub issue

Is there a reason why the deepCopy methods are not public? I see that they were public for some time in an earlier revision then was made “default” access level but I couldn’t find the reason.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:27 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
bohdaqcommented, Nov 3, 2016

Guys please make deepCopy public…

6reactions
mykhaylo-commented, Nov 3, 2016

+1 to make the deepCopy public. This feature is naturally expected to be provided by the gson library. There are lot of cases where you just want to take some your JsonObject as a source (or template) for your further manipulations(adding/removing properties, etc) but keeping the original untouched. with deepCopy you don’t need to reinvent a wheel in every of your projects. you simply use it out of the box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gson JsonObject copy value affected others ... - Stack Overflow
deepCopy method is private!, cannot be used out side its scope, you can use Gson to parse the jsonObject to a string and...
Read more >
JsonObject (Gson 2.8.2 API) - javadoc.io
A class representing an object type in Json. An object consists of name-value pairs where names are strings, and values are any other...
Read more >
How to Make a Deep Copy of an Object in Java - Baeldung
Learn four ways to create a deep copy of an object in Java, and why to prefer a deep copy over a shallow...
Read more >
Object Cloning - Manual - PHP
When an object is cloned, PHP will perform a shallow copy of all of the object's properties. Any properties that are references to...
Read more >
Deep vs. Shallow copying.
A deep copy means actually creating a new array and copying over the values. public class Ex{ private int[] data; // altered to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found