RFR: 8332586: Avoid cloning empty arrays in java.lang.reflect.{Method,Constructor} [v2]

jengebr duke at openjdk.org
Fri May 31 16:21:36 UTC 2024


> Improve `java/lang/reflect/Method.java`  by eliminating needless cloning of Class[0] instances.  This cloning is intended to prevent callers from changing array contents, but smany Methods have zero exceptions or zero parameters, and returning the original `Class[0]` is sufficient.

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

  Adding JMH benchmark

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19327/files
  - new: https://git.openjdk.org/jdk/pull/19327/files/3202c8cb..4865dede

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

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

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


More information about the core-libs-dev mailing list