-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Description
An equality comparison between a SortedArrayStringMap
and a JdkMapAdapterStringMap
is guaranteed to return false
:
public class JdkMapAdapterStringMap implements StringMap {
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (!(object instanceof JdkMapAdapterStringMap)) {
return false;
}
public class SortedArrayStringMap implements IndexedStringMap {
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof SortedArrayStringMap)) {
return false;
}
This is a bummer for unit testing, because otherwise identical maps can be considered unequal depending upon how they were constructed and whether they were copied or just wrapped. The recent efficiency changes in the context map implementation seem to have brought this problem to the fore; evidently there are cases now where immutable maps are wrapped whereas previously they would have been copied.
Metadata
Metadata
Assignees
Labels
apiAffects the public APIAffects the public API
Type
Projects
Status
Done