# HG changeset patch # User Jaroslav Tulach # Date 1460891619 -7200 # Node ID 2d4597793958765c4f6a77d90b2f4d2e68fba49f # Parent aed8434561fca6b2b72c855088615451cb3eaa8a Use boolean.valueOf() to simplify mixing of boxed and unboxed booleans diff -r aed8434561fc -r 2d4597793958 rt/emul/mini/src/main/java/java/lang/Boolean.java --- a/rt/emul/mini/src/main/java/java/lang/Boolean.java Sun Apr 17 07:40:34 2016 +0200 +++ b/rt/emul/mini/src/main/java/java/lang/Boolean.java Sun Apr 17 13:13:39 2016 +0200 @@ -213,12 +213,9 @@ * @return {@code true} if the Boolean objects represent the * same value; {@code false} otherwise. */ - public boolean equals(Object obj) { - if (obj instanceof Boolean) { - return value == ((Boolean)obj).booleanValue(); - } - return false; - } + @JavaScriptBody(args = { "obj" }, body = "return obj && this.valueOf() === obj.valueOf();") + @Override + public native boolean equals(Object obj); /** * Returns {@code true} if and only if the system property