Commit d6aefdb8 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Correct java.util.Objects.equals() being incorrect; Correct the wrong check...

Correct java.util.Objects.equals() being incorrect; Correct the wrong check being performed in java.util.Arrays.equals(Object[], Object[]).
parent c5b2d8a3
......@@ -54,6 +54,8 @@ More detailed changes:
* Corrected bug in `__CanSetPrintStream__` where if it were set to itself
then it could lead to infinite recursion, instead if this kind of
stream is attempted to be set it will use the target.
* Corrected `java.util.Object.equals()` not correctly checking equality
on two objects.
* Fallback encoding is now UTF-8 and not ISO-8859-1.
* If the name of the requested resource is blank, ignore it.
* If a resource was not found, do a traditional search of the classpath
......@@ -819,7 +819,7 @@ public class Arrays
return false;
for (int i = 0; i < na; i++)
if (Objects.equals(__a[i], __b[i]))
if (!Objects.equals(__a[i], __b[i]))
return false;
// No mismatches
......@@ -75,19 +75,15 @@ public final class Objects
public static boolean equals(Object __a, Object __b)
// Which sides are null
boolean na = (__a == null);
boolean nb = (__b == null);
// Same instance or both are null
if (__a == __b)
return true;
// One side is null, but the other is not
if (na != nb)
// Left side is null and right is not, so not the same
else if (__a == null)
return false;
// Both sides are null (just need to check one)
else if (na)
return true;
// Standard equals
// Use standard comparison
return __a.equals(__b);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment