diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-18 16:05:29 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-19 15:06:34 +0300 |
commit | 62d49f3c3af00e7f9a0b324e58bef560b6f9dca0 (patch) | |
tree | 2343c832c926d0c8a2b31cb81cfd44c4db7fe40c /compatibility-client | |
parent | d2a2c61b81e9441e8c3cb36336cca4bbb6c37fd4 (diff) | |
download | vaadin-framework-62d49f3c3af00e7f9a0b324e58bef560b6f9dca0.tar.gz vaadin-framework-62d49f3c3af00e7f9a0b324e58bef560b6f9dca0.zip |
Implement hashCode() when implementing equals()
Diffstat (limited to 'compatibility-client')
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java | 12 | ||||
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java | 13 |
2 files changed, 21 insertions, 4 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java index 0daaff47f9..64cc713e20 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java @@ -227,6 +227,18 @@ public class VFilterSelect extends Composite } return true; } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + VFilterSelect.this.hashCode(); + result = prime * result + ((key == null) ? 0 : key.hashCode()); + result = prime * result + ((caption == null) ? 0 : caption.hashCode()); + result = prime * result + ((untranslatedIconUri == null) ? 0 : untranslatedIconUri.hashCode()); + result = prime * result + ((style == null) ? 0 : style.hashCode()); + return result; + } } /** An inner class that handles all logic related to mouse wheel. */ diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java index 38bb1943cf..2e20abe4a0 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java @@ -7499,10 +7499,15 @@ public class VScrollTable extends FlowPanel return false; } - // - // public int hashCode() { - // return overkey; - // } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((dropLocation == null) ? 0 : dropLocation.hashCode()); + result = prime * result + overkey; + result = prime * result + ((colkey == null) ? 0 : colkey.hashCode()); + return result; + } } public class VScrollTableDropHandler extends VAbstractDropHandler { |