MapFixes found with unit tests.

-Fixed: CollectionWrapper.equals wasn't accounting for self.
-Fixed: MapWrapper.get didn't account for that it was a wrapper.
-Fixed: UnmodifiableMapWrapper was linking to synchronized maps due to a unknown reason.
-Added: UnmodifiableMapWrapper now has a lot more functions it right out says unsupported instead of indirect ways.
This commit is contained in:
2022-06-02 16:21:48 +02:00
parent 086d933a0d
commit c2c2780967
2 changed files with 29 additions and 8 deletions
@@ -185,8 +185,11 @@ public class COLLECTIONS
#endif
@Override
public int hashCode() { synchronized(mutex) { return c.hashCode(); } }
// @Override
// public boolean equals(Object obj) { synchronized(mutex) { return c.equals(obj); } }
@Override
public boolean equals(Object obj) {
if(obj == this) return true;
synchronized(mutex) { return c.equals(obj); }
}
@Override
public String toString() { synchronized(mutex) { return c.toString(); } }
@Override
@@ -307,8 +310,8 @@ public class COLLECTIONS
#endif
@Override
public int hashCode() { return c.hashCode(); }
// @Override
// public boolean equals(Object obj) { return c.equals(obj); }
@Override
public boolean equals(Object obj) { return obj == this || c.equals(obj); }
@Override
public String toString() { return c.toString(); }
@Override