English 中文(简体)
相比之下,在运行时间的ec中,有2个物体(但去除)?
原标题:Compare 2 objects in eclipse in runtime (while debugging)?

我可以比较使用Eclipse(表达工具)的2个物体,试图推翻 Java方案。 我可以做的是,在表达中增加标语,手工扩大标语,以便进行比较,我希望大家一样选择2项标语(当然是同一类),并说“Compare”和Eclipse对标的都是一样的,突出了所有差异。

PS:Im not lazy to do this Manually, its Just that the Object I m deal with is welltric, as its got 10 levels or rangelist of Object :

最佳回答

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:

new Gson().gson.toJson(yourObject1)  

以及

new Gson().gson.toJson(yourObject2)

Then use the json ouput save it to files 以及 use a file comparison tool. Longwinded but with complex objects its often worth it.

问题回答

They can be as detailed or simple as you want them to be. Using a equals expression in the Display view may tel you if two objects are the same, but if their different, it won t tell you what those differences are. Consider using Eclipse detail formatters. They are awesome.

粗略的字眼光短视往往带有不想要的数据,而这种数据只是掩盖了你的思想和你真正感兴趣的内容。 你决定展示的是你选择的详细格式。

见下文关于如何使用这些工具的想法。

rel=“nofollow”http://www.howardism.org/Technical/Eclipse/Eclipse_Detail_Formatter.html

Find “Display” view under debug category. 从java debug的角度来看,它不是默认的。 在辩论会期间,你将可执行非常武断的java声明。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签