On 3/19/18 12:32 PM, Martin Buchholz 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?

But isn't it autounboxing happening when a primitive value gets compared to a Boolean? I suspect the bytecode would be the same, and if this is the case, I would prefer to keep the original line to avoid confusion.

--
With kind regards,
Ivan Gerasimov

Reply via email to