From 97e8cdc5f050fcb391fa5af7d91d73813ccb9a0c Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 9 Feb 2016 21:49:13 -0500 Subject: [PATCH] Remove suppression and implement hashCode Original commit: elastic/x-pack-elasticsearch@0505f28e788bd283ad4a220e833f209178b47824 --- elasticsearch/checkstyle_suppressions.xml | 4 ---- .../src/main/java/org/elasticsearch/shield/SystemUser.java | 5 +++++ .../src/main/java/org/elasticsearch/shield/XPackUser.java | 5 +++++ .../watcher/condition/always/ExecutableAlwaysCondition.java | 5 +++++ .../watcher/condition/never/ExecutableNeverCondition.java | 5 +++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/elasticsearch/checkstyle_suppressions.xml b/elasticsearch/checkstyle_suppressions.xml index dba0c35b865..a1d92ba247e 100644 --- a/elasticsearch/checkstyle_suppressions.xml +++ b/elasticsearch/checkstyle_suppressions.xml @@ -5,8 +5,4 @@ - - - - diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/SystemUser.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/SystemUser.java index bce05d05e20..c453119d57e 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/SystemUser.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/SystemUser.java @@ -32,6 +32,11 @@ public class SystemUser extends User { return o == INSTANCE; } + @Override + public int hashCode() { + return System.identityHashCode(this); + } + public static boolean is(User user) { return INSTANCE.equals(user); } diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/XPackUser.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/XPackUser.java index 55a341a30df..66d4e7f9cc0 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/XPackUser.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/XPackUser.java @@ -68,6 +68,11 @@ public class XPackUser extends User { return INSTANCE == o; } + @Override + public int hashCode() { + return System.identityHashCode(this); + } + public static boolean is(User user) { return INSTANCE.equals(user); } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/condition/always/ExecutableAlwaysCondition.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/condition/always/ExecutableAlwaysCondition.java index 57184a3ca61..0d46fbdeb6d 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/condition/always/ExecutableAlwaysCondition.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/condition/always/ExecutableAlwaysCondition.java @@ -35,4 +35,9 @@ public class ExecutableAlwaysCondition extends ExecutableCondition