[foreign-jextract] RFR: 8277070: Regularize logic for cursor -> position conversion
Jorn Vernee
jvernee at openjdk.java.net
Fri Nov 12 18:38:55 UTC 2021
On Fri, 12 Nov 2021 18:14:27 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> TreeMaker::toPos has the correct logic to extract a Position from a cursor, which avoids any potential NPEs. Unfortunately jextract code does not use it uniformly, especially `RecordLayoutComputer` and its subclasses. This patch turns the method into a static helper and makes the `CursorPosition` constructor private, so that other clients have to go through the static factory.
LGTM!
-------------
Marked as reviewed by jvernee (Committer).
PR: https://git.openjdk.java.net/panama-foreign/pull/613
More information about the panama-dev
mailing list