Debug Problem with java.util.Map implementations in 5.1.1

I am having a consistent problem debugging in 5.1.1, within any object that implements java.util.Map. If I stop at a breakpoint within one of these classes, "this" cannot resolve -- I get an error in the Frame tab that says "unable to evaluate the expression java.lang.NullPointerException : " when I try to open up the "this" node.

Also, the description of the "this" node displays the object instance id (as usual), but the description of the object simply says "size = 0" regardless of whether the object overrides the "toString" method or how many objects there actually are in the map.

Is this a known bug?

Thanks,
ken

3 comments
Comment actions Permalink

You can customize the data views within the debugger.
Select the "Frame"-Tab in the debugger view and press right mousebutton.
In the popup menu you can use "Customize Data Views" where the option
"Alternate view for Collection classes" is surly enabled. That should be
the reason why "size=0" is displayed.

The mentioned exception may occur due to an buggy map implementation.

Ken Clark schrieb:

I am having a consistent problem debugging in 5.1.1, within any object that implements java.util.Map. If I stop at a breakpoint within one of these classes, "this" cannot resolve -- I get an error in the Frame tab that says "unable to evaluate the expression java.lang.NullPointerException : " when I try to open up the "this" node.

Also, the description of the "this" node displays the object instance id (as usual), but the description of the object simply says "size = 0" regardless of whether the object overrides the "toString" method or how many objects there actually are in the map.

Is this a known bug?

Thanks,
ken

0
Comment actions Permalink

Thanks -- that workaround fixes the problem.

I think the issue with these particular Map implementations is that they were built for JSF integration -- which only requires the get and put methods be implemented, and so the other methods are not fully implemented.

0
Comment actions Permalink

Yep, the NPE you are getting is raised when debugger tries to render the java.util.Map object instance when evaluating the following
expressions:
"size()" and "entrySet().toArray()" and "isEmpty()".
I suspect that the "entrySet()" method returns null.
In order to explore the object instance you need to switch off the "Alternate Collection View" option


--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.