RFR: 8319386: Migrate Class::getEnclosingMethod/Constructor away from old generic utilities

Chen Liang liach at openjdk.org
Fri Nov 3 14:08:16 UTC 2023


Please review a patch that migrates `Class::getEnclosingMethod` and `Class::getEnclosingConstructor`'s descriptor parsing from old generic utilities to more simple utilities from java.lang.invoke implementation. This will help migrate away from the old generic repositories in the future.

The `getClassLoader()` call plus https://github.com/openjdk/jdk/blob/1a21c1a783d64ca0930c358c06a43975f96ffac6/src/java.base/share/classes/sun/invoke/util/BytecodeDescriptor.java#L93
should be functionally equivalent to the previous `getDeclsLoader()`
https://github.com/openjdk/jdk/blob/1a21c1a783d64ca0930c358c06a43975f96ffac6/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java#L60-L68
plus
https://github.com/openjdk/jdk/blob/1a21c1a783d64ca0930c358c06a43975f96ffac6/src/java.base/share/classes/sun/reflect/generics/factory/CoreReflectionFactory.java#L113-L114

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

Commit messages:
 - Migrate getEnclosingMethod/Constructor away from old generic utilities

Changes: https://git.openjdk.org/jdk/pull/16496/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16496&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8319386
  Stats: 31 lines in 1 file changed: 1 ins; 24 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/16496.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16496/head:pull/16496

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


More information about the core-libs-dev mailing list