> Hi everyone, `ClassPrintLayout::class_print_layout` expects internal class 
> names as its argument, but is called externally by users through `jcmd`. This 
> leads to inconsistencies with other commands. For example:
> 
> 
> jcmd <pid> VM.class_hierarchy java.lang.String
> jcmd <pid> VM.class_print_layout java/lang/String
> 
> 
> In addition, the command's output is also in the internal format. This should 
> be changed to also use the external dotted class name instead. To resolve 
> this, I added a conversion step that replaces external dotted names with 
> internal slashed names in-place before we start searching for classes. That 
> way we avoid extra allocations and string comparisons. As a side effect, this 
> now works on both internal and external names, as slashes are left untouched.
> 
> This was a previously approved PR in 
> https://github.com/openjdk/valhalla/pull/2375, but did not get integrated in 
> time.
> 
> Testing:
> 
> - Tier 1
> - Manual inspection with jcmd
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Casper Norrbin has updated the pull request incrementally with one additional 
commit since the last revision:

  Add resource strcpy

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/32396/files
  - new: https://git.openjdk.org/jdk/pull/32396/files/c03f1b0f..ab9f2105

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32396&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32396&range=00-01

  Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/32396.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32396/head:pull/32396

PR: https://git.openjdk.org/jdk/pull/32396

Reply via email to