RFR: 7903631: Improve names for getter/setters

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jan 16 15:21:00 UTC 2024


This patch improves the parameter names for getter/setter methods generated inside a struct.

As I was writing this I realized that:

* we were not using `safeParameterName` consistently. So I've sprinkled that to cover all generated methods;
* we were not generating a setter for fields whose type was a by-value struct. A new setter is now added (which uses `MemorySegment::copy`). A test has also been added.

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

Commit messages:
 - Initial push

Changes: https://git.openjdk.org/jextract/pull/179/files
 Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=179&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903631
  Stats: 154 lines in 3 files changed: 135 ins; 0 del; 19 mod
  Patch: https://git.openjdk.org/jextract/pull/179.diff
  Fetch: git fetch https://git.openjdk.org/jextract.git pull/179/head:pull/179

PR: https://git.openjdk.org/jextract/pull/179


More information about the jextract-dev mailing list