[foreign-jextract] Integrated: 8277070: Regularize logic for cursor -> position conversion

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Nov 12 18:50:51 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.

This pull request has now been integrated.

Changeset: 91bf4694
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/91bf46942faa8f7cac560874df1d3df52d5dc7dc
Stats:     44 lines in 5 files changed: 12 ins; 15 del; 17 mod

8277070: Regularize logic for cursor -> position conversion

Reviewed-by: jvernee

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

PR: https://git.openjdk.java.net/panama-foreign/pull/613


More information about the panama-dev mailing list