Skip to content

Commit

Permalink
Merge pull request square#145 from square/jw/small
Browse files Browse the repository at this point in the history
Small tweaks.
  • Loading branch information
edenman committed Feb 15, 2013
2 parents e650d65 + 28fdb93 commit 4c894bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions retrofit/src/main/java/retrofit/io/TypedByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public void writeTo(OutputStream out) throws IOException {
return bytes.length;
}

@Override
public boolean equals(Object o) {
@Override public boolean equals(Object o) {
if (this == o) return true;

if (o instanceof TypedByteArray) {
Expand All @@ -43,8 +42,7 @@ public boolean equals(Object o) {
return false;
}

@Override
public int hashCode() {
@Override public int hashCode() {
return Arrays.hashCode(bytes);
}
}
8 changes: 3 additions & 5 deletions retrofit/src/main/java/retrofit/io/TypedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void writeTo(OutputStream out) throws IOException {
* @throws java.io.IOException if the move fails
*/
public void moveTo(TypedFile destination) throws IOException {
if (mimeType() != destination.mimeType()) {
if (!mimeType().equals(destination.mimeType())) {
throw new IOException("Type mismatch.");
}
if (!file.renameTo(destination.file())) {
Expand All @@ -62,8 +62,7 @@ public void moveTo(TypedFile destination) throws IOException {
return file.getAbsolutePath() + " (" + mimeType() + ")";
}

@Override
public boolean equals(Object o) {
@Override public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof TypedFile) {
TypedFile rhs = (TypedFile) o;
Expand All @@ -72,8 +71,7 @@ public boolean equals(Object o) {
return false;
}

@Override
public int hashCode() {
@Override public int hashCode() {
return file.hashCode();
}

Expand Down

0 comments on commit 4c894bd

Please sign in to comment.