Can I compare 2 Objects using the Eclipse – Expressions tool, am trying to debug a Java program. The max I can do is, add both the objects to Expressions and manually expand the object to compare, I wish there was like, select 2 Object (of same kind – Class, Of course) and say “Compare” and Eclipse parses both the objects and highlights all the differences..
PS: I’m not lazy to do this manually, its just that the Object I’m dealing with is very complicated, like its got 10 levels or arraylist of Objects 🙂
Not a elegant solution but it has worked well for me in the past is to include something like gson or other json parser in your classpath. Then in the Display view type:
and
Then use the json ouput save it to files and use a file comparison tool.
Longwinded but with complex objects its often worth it.