Eclipse Java Debugger Receives Method Call Results

I have a relatively complex object that, among other things, contains a ConcurrentHashMap inside it. In the debugger, I would like to see the results of calling the .size () method, but I really do not want this in my code and do not want to embed it.

Image debugger http://img153.imageshack.us/img153/1695/will.png .

You can see what I have, but id love, in order to be able to somehow call / see the results of the .size () method

However, I can see many links to Maps and segments, etc., but they are just meanings.

Just wondering if this is possible?

+4
source share
3 answers

As an alternative to running the size () method in the View view, you can simply click the Show Logical Structure button in the Variables window, and your Map display will change to view as an array of records. Array size is the size of your card.

+4
source

In the debugger, open the View view. This will allow you to evaluate the entered expression.

See http://www.ibm.com/developerworks/library/os-ecbug/ in the Scrapbooking Your Live Code section.

Here is a more detailed article: http://larsho.blogspot.com/2008/07/my-favorite-eclipse-view.html

+10
source

I would use log4j and draw debug output:

if (log.isDebugEnabled()) { log.debug("size: " + myConcurrentHashMap.size()); } 

This .size () method is only called when you are in the debug log level ...

0
source

Source: https://habr.com/ru/post/1300998/


All Articles