From 618c1f9fe0caef7790af409eeaea12312a1bf1a7 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Thu, 30 Jun 2016 13:19:58 +0300 Subject: [PATCH] 'hashCode()' called on array warnings fixed --- .../testSrc/com/intellij/history/core/storage/TestContent.java | 3 ++- .../jetbrains/idea/maven/vfs/MavenPropertiesVirtualFile.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java b/platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java index c74068ff4beb..602fc288cf87 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java +++ b/platform/platform-tests/testSrc/com/intellij/history/core/storage/TestContent.java @@ -43,11 +43,12 @@ public class TestContent extends Content { @Override public boolean equals(Object o) { + if (!(o instanceof Content)) return false; return Arrays.equals(myData, ((Content)o).getBytes()); } @Override public int hashCode() { - return myData.hashCode(); + return Arrays.hashCode(myData); } } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenPropertiesVirtualFile.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenPropertiesVirtualFile.java index 000b855c5ac4..baa3b46c4a10 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenPropertiesVirtualFile.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenPropertiesVirtualFile.java @@ -24,6 +24,7 @@ import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Arrays; import java.util.Properties; import java.util.Set; import java.util.TreeSet; @@ -109,7 +110,7 @@ public class MavenPropertiesVirtualFile extends VirtualFile { @Override public long getModificationStamp() { - return myContent.hashCode(); + return Arrays.hashCode(myContent); } @Override