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:
+7
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user