How to find difference between cloned object and orignal object in java?

StackOverflow https://stackoverflow.com/questions/19061882

  •  29-06-2022
  •  | 
  •  

سؤال

I am doing deep cloning. I am not considering some components of objects while cloning since it's contains lot of elements. Now there is some code which uses that object , my code is failing because it needs some specific fields for working but they may not be there in clonned object.

Wondering, if there is any shortcut for detecting change

هل كانت مفيدة؟

المحلول

You can dump the two variations using XMLEncoder and compare the text. e.g. using windiff or you favourite diffing program.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top