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

Handling primitive values as part of object cloning #68

Open
eladh opened this issue Dec 24, 2017 · 0 comments
Open

Handling primitive values as part of object cloning #68

eladh opened this issue Dec 24, 2017 · 0 comments

Comments

@eladh
Copy link

eladh commented Dec 24, 2017

Hi @kostaskougios

as part of our object graph we got an inner element that contains primitive members that if the custom cloning strategy return NULL_INSTEAD_OF_CLONE.

we getting

java.lang.IllegalArgumentException: Can not set int field com.idi.pearl.framework.cloning.domain.C.x to null value

	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
	at sun.reflect.UnsafeIntegerFieldAccessorImpl.set(UnsafeIntegerFieldAccessorImpl.java:80)
	at java.lang.reflect.Field.set(Field.java:758)
	at com.rits.cloning.Cloner.cloneObject(Cloner.java:460)
	at com.rits.cloning.Cloner.cloneInternal(Cloner.java:442)
	at com.rits.cloning.Cloner.deepClone(Cloner.java:312)

this issue can be supported via custom cloning strategy transformer or a dedicated primitives support ,
for example the NULL_INSTEAD_OF_CLONE for int will be = ??

best,
elad

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

No branches or pull requests

1 participant