On Wed, 2 Mar 2022 20:28:45 GMT, Joe Darcy <da...@openjdk.org> wrote:
> Refactoring of Method and Constructor to share a single empty array for > parameters and exceptions as well as type variables. > > Existing core reflection regression tests pass with the change. src/java.base/share/classes/java/lang/reflect/Executable.java line 61: > 59: static final TypeVariable[] NO_TYPE_VARS = new TypeVariable[0]; > 60: > 61: static final Class<?>[] NO_TYPES = new Class<?>[0]; Less concerning since it doesn't add extra classloading, but I note that we have similar constants in a few places, including `j.l.Class.EMPTY_CLASS_ARRAY` and `j.l.r.ProxyGenerator.EMPTY_CLASS_ARRAY`. Perhaps would make sense to consolidate these into a single place/instance (and use consistent names) ------------- PR: https://git.openjdk.java.net/jdk/pull/7667