RFR: 8338471: Refactor Method::get_new_method() for better NoSuchMethodError handling [v2]

David Holmes dholmes at openjdk.org
Tue Sep 10 06:53:05 UTC 2024


On Mon, 9 Sep 2024 22:28:20 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> So is it the case that `nullptr` implies deleted, and deleted implies `nullptr`? If so checking for both is redundant and confusing because it makes it look like there are two distinct cases.
>
> So that implies that you trust my reading of this code.  It is complicated enough that testing both seems like a safe thing to do and somewhat clarifying, or else adding an assert like:
> 
>     assert(new_method != nullptr || old_method->is_deleted(), "this is the only way this happens");
>     return new_method == nullptr ? nsme : new_method;

The assert works for me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20874#discussion_r1751358981


More information about the hotspot-dev mailing list