On Tue, 27 Aug 2024 21:21:01 GMT, David Holmes <dhol...@openjdk.org> wrote:

> If you try to accommodate arbitrary future use then every method in the VM 
> would need to enforce every single precondition and invariant it expects 
> "just in case" and that is not practical.

I'm basically arguing for Functional Testing here, or at least having some 
invariants the would allow functional testing.  It may seem impractical to 
retrofit existing code, but when we are changing the input from int to size_t, 
that seems like the perfect time to enforce the new invariants.  If we expect 
"len" to be <= INT_MAX instead of SIZE_MAX, something that is not obvious from 
its type, then why not check that with an assert or at least document it?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20560#discussion_r1733651059

Reply via email to