It's surprising that both variants don't perform the same when JIT compiled.
On Mon, Mar 19, 2018 at 3:32 PM, Martin Buchholz <[email protected]> wrote: > > > > */ > > public boolean equals(Object obj) { > > if (obj instanceof Boolean) { > > - return value == ((Boolean)obj).booleanValue(); > > + return value == (Boolean) obj; > > } > > > > > This is not correct, since we might have multiple Boolean objects that are > equals, but not ==. > Do we have a test that would catch this? >
