From 28fdb930a1245ed7513a5127253345d0ac724531 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Thu, 14 Feb 2013 17:39:19 -0800 Subject: [PATCH] Small tweaks. --- retrofit/src/main/java/retrofit/io/TypedByteArray.java | 6 ++---- retrofit/src/main/java/retrofit/io/TypedFile.java | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/retrofit/src/main/java/retrofit/io/TypedByteArray.java b/retrofit/src/main/java/retrofit/io/TypedByteArray.java index 9e43491a4d..3561970591 100644 --- a/retrofit/src/main/java/retrofit/io/TypedByteArray.java +++ b/retrofit/src/main/java/retrofit/io/TypedByteArray.java @@ -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) { @@ -43,8 +42,7 @@ public boolean equals(Object o) { return false; } - @Override - public int hashCode() { + @Override public int hashCode() { return Arrays.hashCode(bytes); } } \ No newline at end of file diff --git a/retrofit/src/main/java/retrofit/io/TypedFile.java b/retrofit/src/main/java/retrofit/io/TypedFile.java index 98746ddabd..2e79b515a3 100644 --- a/retrofit/src/main/java/retrofit/io/TypedFile.java +++ b/retrofit/src/main/java/retrofit/io/TypedFile.java @@ -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())) { @@ -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; @@ -72,8 +71,7 @@ public boolean equals(Object o) { return false; } - @Override - public int hashCode() { + @Override public int hashCode() { return file.hashCode(); }