Class.getSimpleName not suitable for non-Java classes

Daniel Armak danarmak at gmail.com
Mon Mar 13 18:57:06 UTC 2017


The attached patch simply replaces the 3 calls to getSimpleName with
getName. The tests pass successfully. The output of sample #1 now looks
like this:

org.openjdk.jol.samples.JOLSample_01_Basic$A object internals:
 OFFSET  SIZE      TYPE DESCRIPTION                                      VALUE
      0    12           (object header)                                  N/A
     12     1   boolean org.openjdk.jol.samples.JOLSample_01_Basic$A.f   N/A
     13     3           (loss due to the next object alignment)
Instance size: 16 bytes
Space losses: 0 bytes internal + 3 bytes external = 3 bytes total

​
Thanks,

-- 
Daniel Armak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dont_call_getSimpleName.patch
Type: text/x-patch
Size: 1649 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/jol-dev/attachments/20170313/e02238fb/Dont_call_getSimpleName.patch>


More information about the jol-dev mailing list