On Tue, 13 Jan 2026 05:26:44 GMT, David Holmes <[email protected]> wrote:

>> 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.

But again the assertion (if present) is in place of the runtime check.

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

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

Reply via email to