You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by hs...@apache.org on 2015/03/31 19:54:33 UTC

flink git commit: [FLINK-1766]Fix the bug of equals function of FSKey

Repository: flink
Updated Branches:
  refs/heads/master 224fa94c6 -> d8c74d209


[FLINK-1766]Fix the bug of equals function of FSKey

The equals function in org.apache.flink.core.fs.FileSystem.FSKey should first confirm whether obj == this, if obj is the same object.It should return true

Author: hongsibao <ho...@huawei.com>

Closes #511 from matadorhong/Bug_Flink_1776 and squashes the following commits:

1ad06d7 [hongsibao] Fix the code format problem
431fc4b [hongsibao] Fix the code format problem
ab0ae5e [hongsibao] [FLINK-1766]Fix the bug of equals function of FSKey


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/d8c74d20
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/d8c74d20
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/d8c74d20

Branch: refs/heads/master
Commit: d8c74d20970e6cf379165ffafe8550a5b98d7c4d
Parents: 224fa94
Author: hongsibao <ho...@huawei.com>
Authored: Tue Mar 31 10:54:27 2015 -0700
Committer: Henry Saputra <he...@gmail.com>
Committed: Tue Mar 31 10:54:27 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/core/fs/FileSystem.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d8c74d20/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
index 7e8c667..0e38d8a 100644
--- a/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
+++ b/flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
@@ -106,6 +106,9 @@ public abstract class FileSystem {
 		 */
 		@Override
 		public boolean equals(final Object obj) {
+			if (obj == this) {
+				return true;
+			}
 
 			if (obj instanceof FSKey) {
 				final FSKey key = (FSKey) obj;
@@ -127,7 +130,6 @@ public abstract class FileSystem {
 		 */
 		@Override
 		public int hashCode() {
-
 			if (this.scheme != null) {
 				return this.scheme.hashCode();
 			}