On Mon, 19 Dec 2022 14:24:58 GMT, Tejesh R <[email protected]> wrote: > Means the other constructor is called in two places only and in those places > null checks are done. So, even if we add assertion inside constructor, it > will unreachable.
It won't be unreachable, _it will prevent such a situation from happening again_. The code which calls the other constructor could be changed. I still think it's reasonable to add the assertion. It's a no-op if assertions aren't enabled (the default), and it'll catch the broken invariant in testing since tests are (usually) run with assertions enabled. ------------- PR: https://git.openjdk.org/jdk/pull/11104
