Permalink
Browse files

Merge pull request #53 from ngriso/master

TFJ-666 Stop calling URL.hashcode()
  • Loading branch information...
2 parents 8821e57 + 54aff64 commit aaa0f9a9ac5eac6841f95da337239d024c02d7a2 @yusuke committed Jun 4, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 twitter4j-core/src/main/java/twitter4j/internal/json/URLEntityJSONImpl.java
@@ -144,9 +144,9 @@ public boolean equals(Object o) {
if (start != that.start) return false;
if (displayURL != null ? !displayURL.equals(that.displayURL) : that.displayURL != null)
return false;
- if (expandedURL != null ? !expandedURL.equals(that.expandedURL) : that.expandedURL != null)
+ if (expandedURL != null ? !expandedURL.toString().equalsIgnoreCase(that.expandedURL.toString()) : that.expandedURL != null)
return false;
- if (url != null ? !url.equals(that.url) : that.url != null)
+ if (url != null ? !url.toString().equalsIgnoreCase(that.url.toString()) : that.url != null)
return false;
return true;
@@ -156,8 +156,8 @@ public boolean equals(Object o) {
public int hashCode() {
int result = start;
result = 31 * result + end;
- result = 31 * result + (url != null ? url.hashCode() : 0);
- result = 31 * result + (expandedURL != null ? expandedURL.hashCode() : 0);
+ result = 31 * result + (url != null ? url.toString().hashCode() : 0);
+ result = 31 * result + (expandedURL != null ? expandedURL.toString().hashCode() : 0);
result = 31 * result + (displayURL != null ? displayURL.hashCode() : 0);
return result;
}

0 comments on commit aaa0f9a

Please sign in to comment.