RFR: 8261269: When using clhsdb to "inspect" a java object, clhsdb prints "Oop for..." twice [v2]

Chris Plummer cjplummer at openjdk.java.net
Thu Feb 18 06:45:39 UTC 2021


On Wed, 17 Feb 2021 23:30:04 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Put replicated strings into a local variable.
>
> 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!

-------------

PR: https://git.openjdk.java.net/jdk/pull/2582


More information about the serviceability-dev mailing list