On Fri, 9 Jan 2026 17:43:14 GMT, Leonid Mesnik <[email protected]> wrote:

>> good question, but I think defensive coding is warranted, and this is not a 
>> performance sensitive code path IMO
>
> I would prefer to add assertion it such cases. So we can see during testing 
> if assumption is incorrect.  It also helps to find changed invariants earlier.
> The defensive code path might be fine for product to don't bother users with 
> crashes.

My concern with "defensive coding" like this is that it implies we do not know 
the answer to the question and we should know it. In this case asserting we 
have an InstanceKlass seems preferabled to me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29048#discussion_r2684879556

Reply via email to