RFR: JDK-8317635: Improve GetClassFields test to verify correctness of field order [v3]

Alex Menkov amenkov at openjdk.org
Thu Oct 19 02:19:35 UTC 2023


> All test cases in getclfld007 had 1 (or 0) field in test classes/interfaces.
> The change adds several fields in one of the test classes to verify order of the returned fields (as described by GetClassFields spec: "in the order they occur in the class file").
> Field order in the class file is not guaranteed to be the same as in the source, so information about expected fields and expected order is extracted by ASM (it parses class file sequentially).
> This allows to drop hardcoded field name/type in native part.
> 
> Additionally did some test cleanup:
> - dropped "printdump" stuff (the test always logs reported fields);
> - removed unused `generic` in native check() method, added deallocation of `name` and `sig`

Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:

  Serguei feedback

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16131/files
  - new: https://git.openjdk.org/jdk/pull/16131/files/bd48a0b0..16856fe4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16131&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16131&range=01-02

  Stats: 44 lines in 2 files changed: 18 ins; 17 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/16131.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16131/head:pull/16131

PR: https://git.openjdk.org/jdk/pull/16131


More information about the serviceability-dev mailing list