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

Per Minborg pminborg at openjdk.org
Mon Jan 29 17:24:37 UTC 2024


On Tue, 16 Jan 2024 09:10:04 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> 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.

We could add such a method under another issue (https://bugs.openjdk.org/browse/JDK-8323746) because it will be much easier to implement it once the contemplated changes for that issue are in.

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

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


More information about the core-libs-dev mailing list