RFR: 8261269: When using clhsdb to "inspect" a java object, clhsdb prints "Oop for..." twice [v2]
Kevin Walls
kevinw at openjdk.java.net
Mon Feb 22 12:07:41 UTC 2021
On Thu, 18 Feb 2021 06:43:04 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> It looks good to me.
>> One side comment about the test. It is not easy to read the code with the same pattern (e.g. "Oop for java/io/BufferedInputStream") repeated several times. I understand, you prefer to make it more explicit but it'd be more readable if a predefined pattern is used like below:
>> String pattern = "Oop for java/io/BufferedInputStream";
>> + expStrMap.put(cmd, List.of("instance of Oop for java/lang/Class @ " + examineResult,
>> + "in: " + pattern + @"));
>> . . .
>> + unexpStrMap.put(cmd, List.of(
>> + "instance of Oop for java/lang/Class @ " + examineResult + " @ " + examineResult,
>> + "in: " + pattern + " .* " + pattern));
>>
>> Just an opinion with no pressure. It is up to you.
>>
>> Thanks,
>> Serguei
>
> Good idea. I've added the pattern strings. Thanks!
That's great, much more readable output!
Looks good.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2582
More information about the serviceability-dev
mailing list