Unable to figure out HashMap values - (use of Hash Entries context menu) [message #665554] |
Fri, 15 April 2011 05:08  |
Eclipse User |
|
|
|
Hi - I am new to Eclipse forums and the MAT plugin.
I am trying to review the contents of a HashMap which is an instance attribute of a certain class. I got to the point of writing the correct OQL query to view the list of java.util.HashMap.
select _attributes from com.sample.AClassWithHashMapVariable
So far so good. As I couldnt figure out a way to get to a particular key through the query, i thought the next best thing would be to use the Hash Entries menu.
But I am unable to view the contents of this hashmap using the Java Collections --> Hash Entries context menu. Actually, I am finding the Hash Entries slightly unintuitive. I just want to do something like this.
select _attributes.get("key") from com.sample.AClassWithHashMapVariable
I toyed with it for a couple of hours, tried setting the key value to the "-key_attribute" parameter, but nothing comes of it. The documentation talks about "custom (eg. non-jdk) map class" for all the attributes which I am unable to understand.
Sorry if this is a repetitive question, but i searched in this and the previous forums but did not find the answer to this. In fact one fine gentleman had suggested the use of Hash Entries for a similar question, but the original poster did not respond as to whether it worked out for him or not.
Any help would be greatly appreciated.
Regards,
Arun.
[Updated on: Fri, 15 April 2011 05:14] by Moderator Report message to a moderator
|
|
|
Re: Unable to figure out HashMap values - (use of Hash Entries context menu) [message #665642 is a reply to message #665554] |
Fri, 15 April 2011 11:04  |
Eclipse User |
|
|
|
With the sample dump then this works for extracting objects which you can then run the Hash Entries query on:
SELECT objects lmap FROM sun.misc.URLClassPath$JarLoader
or for your example
select objects _attributes from com.sample.AClassWithHashMapVariable
Without the 'objects' keyword then each line is the object retrieved from by the select, and each column are the items specified in the select clause, which is just the _attributes field in your example.
The context menu operates on the object representing the entire row, which was the com.sample.AClassWithHashMapVariable object, which won't work with the hash entries query.
|
|
|
Powered by
FUDForum. Page generated in 0.02780 seconds