开发者

Watch Date in Eclipse for Java Application

I have been trying to add to the Watch window a Java Date object (java.util.Date). Sometimes, when i hover over a Date in the source editor view, it shows the Date value in a readable format (e.g. 2009 Oct 26 14...) but sometimes, it just does not show the Date value but it only shows the declaration of the date variable/identifier. So as an alternative so that I could see the Date value, I tried adding it to the watch.

What I see in the Watch is something like this (for example the Date identifier is nowTime)

- x+y? "nowTime" = Date (id=136)
   +- cdate= Gregorian$Date (id=139)
   |- fastTime = 1256604393000

I am thinking that I could extra code by setting the Date as Calendar value and getting the component of the Calendar. But this requires code change just to Debug. This codes are sometimes not deleted and makes the code messy. Is there any other way to fix this? Or are there other watch expression that I could use without adding helper debug codes开发者_运维问答? Is there any


You could edit the watch to nowTime.toString() to get readable information

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜