[PATCH] unnecessary null check inside of java.lang.Boolean.valueOf(String)

Martin Buchholz martinrb at google.com
Mon Mar 19 19:32:08 UTC 2018


>
>       */
>      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?


More information about the core-libs-dev mailing list