Created
December 10, 2013 18:34
-
-
Save mvberg/7895635 to your computer and use it in GitHub Desktop.
VisualVM Object Query for HashMap that prints their key->value entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select map(heap.objects('com.barchart.osgi.factory.api.util.Props'), | |
function (it) { | |
var res = ''; | |
var tables = toArray(it.table); | |
for(i = 0;i< tables.length;i++) { | |
var e = tables[i]; | |
while(e != null) { | |
if(e.key != null) { | |
res += e.key.toString(); | |
}else { | |
res += 'nullKey'; | |
} | |
if(e.value!= null) { | |
res += " -> " + toHtml(e.value.toString()); | |
}else { | |
res += " -> null"; | |
} | |
res += "<br/>"; | |
e = e.next; | |
} | |
} | |
return res + "<br>"; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment