RFR: 8323601: Improve LayoutPath.PathElement::toString [v2]

Per Minborg pminborg at openjdk.org
Tue Jan 16 09:12:21 UTC 2024


On Mon, 15 Jan 2024 17:10:47 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rework PathElement:toString
>
> src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 958:
> 
>> 956:             return new LayoutPath.PathElementImpl(PathKind.DEREF_ELEMENT,
>> 957:                     LayoutPath::derefElement,
>> 958:                     "*");
> 
> It seems that this would result in paths like `a.b*` rather than the `*a.b`, which is correct C syntax.

Correct. Additional logic is needed to form a correct C syntax. It would be possible to provide a method that does this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17417#discussion_r1453127266


More information about the core-libs-dev mailing list