Skip to content

Commit

Permalink
[fix] wrong "equals" implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
unixzii authored and gejiaheng committed Jun 16, 2017
1 parent 3812ce4 commit abb47a0
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ public boolean equals(Object obj) {
}

Item other = (Item) obj;
return other.uri.equals(uri);
return id == other.id
&& (mimeType != null && mimeType.equals(other.mimeType)
|| (mimeType == null && other.mimeType == null))
&& (uri != null && uri.equals(other.uri)
|| (uri == null && other.uri == null))
&& size == other.size
&& duration == other.duration;
}

@Override
Expand All @@ -145,4 +151,4 @@ public int hashCode() {
result = 31 * result + Long.valueOf(duration).hashCode();
return result;
}
}
}

0 comments on commit abb47a0

Please sign in to comment.