Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like to ignore certain "instance" fields from my cloning process. #24

Open
GoogleCodeExporter opened this issue Mar 31, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a Parent object that contains a List of Child objects.
2. Create a Child object has a reference to its Parent.
3. Parent parent = null;
4. Child child = null;
5. parent.addChild(child);
6. child.setParent(parent);
7. cloner.deepClone(child);

What is the expected output? What do you see instead?
The cloned instance of child has a new copy of parent with a list of copies of 
child.

I would like the cloner to ignore the "parent" field in the child instance and 
not clone it.

What version of the product are you using? 
1.9.0
On what operating system?
Win 7 Enterprise

Please provide any additional information below.
I tried to use the following:
cloner.registerConstant(Child.class, "parent");
But because "parent" is an instance field and not static (i.e. constant) I get 
a NullPointerException.

Original issue reported on code.google.com by waul...@gmail.com on 10 Dec 2013 at 10:10

@GoogleCodeExporter
Copy link
Author

hmm, child instance should be == with the parent.child instance, no?

Original comment by kostas.k...@googlemail.com on 21 Jun 2014 at 8:49

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant