I am trying to create an OQL query in Eclipse MAT to select a bunch of objects from a Java heapdump with LocalDateTime
fields. Simply calling the .toString()
function of the object just returns the object address, e.g. this:
SELECT mci.firstName.toString(), mci.importantDateTime.toString() AS mydatetime FROM com.example.MyClass$Inner mci WHERE (mci.firstName.toString() = "John")
returns John | java.time.LocalDateTime @ 0x83be8420
How do I convert the object to a human-readable datetime string?
Once again to make it crystal clear: I don't want to parse a date time in Java. I need an Object Query Language (OQL) statement that produces a human readable string out of a LocalDateTime
field.
Something like this could help:
Modify this replacing
l
withmci.importantDateTime
.Alternatively, you could write an extension for MAT with a class specific name resolver org_eclipse_mat_api_nameResolver for
java.time.LocalDateTime
,java.time.LocalDate
andjava.time.LocalTime
.