RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v11]

Chen Liang liach at openjdk.org
Tue May 2 13:48:31 UTC 2023


On Tue, 2 May 2023 13:19:55 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 24 additional commits since the last revision:
>> 
>>  - Renames
>>  - Merge branch 'master' into explore/mhp-iface
>>  - Consolidate iteration over public methods
>>  - Define MH proxy class in a dynamic module
>>  - Fix test that depend on WrapperInstance
>>  - Require an original lookup in constructor arguments to prevent unintended instantiation
>>  - pass interface info via condy,
>>    drop explicit ea flags
>>    initialize benchmark work variable randomly
>>    benchmarks just need 1 fork
>>  - Nuke WrapperInstance
>>  - Merge branch 'master' into explore/mhp-iface
>>  - Whitespace, cleanup, rename benchmarks to be informative
>>  - ... and 14 more: https://git.openjdk.org/jdk/compare/856693aa...f5d0ef0a
>
> src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line 225:
> 
>> 223:             proxy = lookup.findConstructor(lookup.lookupClass(), methodType(void.class, Lookup.class))
>> 224:                           .invoke(lookup);
>> 225:             assert proxy.getClass().getModule().isNamed() : proxy.getClass() + " " + proxy.getClass().getModule();
> 
> This `assert` should be moved after the `try` statement.

No different; we always rethrow any `Error` so an `AssertionError` will be thrown normally. We do not intend to continue normal execution if the try block fails.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1182572029


More information about the core-libs-dev mailing list