RFR: 8299505: findVirtual on array classes incorrectly restricts the receiver type [v3]

Chen Liang liach at openjdk.org
Wed May 31 05:25:32 UTC 2023


> The access hack for array class clone is only applied to `checkAccess` but missing before call to `restrictProtectedReceiver`, causing the array receiver type to be incorrectly replaced by the lookupClass type. This patch fixes that and adds a test to ensure an original lookup resolves `clone` for both array classes (public) and Object (inherited protected) correctly, and restores the old MethodHandlesGeneralTest from [JDK-8001105](https://bugs.openjdk.org/browse/JDK-8001105) which ensures correctness for publicLookup (which is already correct).

Chen Liang has updated the pull request incrementally with one additional commit since the last revision:

  Make test MH invocation slightly more readable

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13855/files
  - new: https://git.openjdk.org/jdk/pull/13855/files/532ea964..9687f01d

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

  Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/13855.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13855/head:pull/13855

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


More information about the core-libs-dev mailing list