RFR: 8311500: StackWalker.getCallerClass() can throw if invoked reflectively

Volker Simonis simonis at openjdk.org
Wed Jul 5 11:52:11 UTC 2023


As the included jtreg test demonstrates, `StackWalker.getCallerClass()` can throw an `UnsupportedOperationException` if called reflectively. Currently this only happens if we invoke `StackWalker.getCallerClass()` recursively reflectively, but this issue will become more prominent once we fix [JDK-8285447](https://bugs.openjdk.org/browse/JDK-8285447).

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

Commit messages:
 - 8311500: StackWalker.getCallerClass() can throw if invoked reflectively

Changes: https://git.openjdk.org/jdk/pull/14773/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14773&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8311500
  Stats: 83 lines in 3 files changed: 78 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/14773.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14773/head:pull/14773

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


More information about the core-libs-dev mailing list