summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/AbstractOrderedLayout.java
diff options
context:
space:
mode:
authorJuuso Valli <juuso@vaadin.com>2014-09-11 16:34:03 +0300
committerJuuso Valli <juuso@vaadin.com>2014-09-12 13:40:25 +0300
commit5020466294352484f75fbe64658ec79f6aa7a0e6 (patch)
tree0d0055c3fbe25cf7986240e6cd28137a0d4f0be1 /server/src/com/vaadin/ui/AbstractOrderedLayout.java
parent9325ffe05b19b814d7e514a61d1c14dfe77ae156 (diff)
downloadvaadin-framework-5020466294352484f75fbe64658ec79f6aa7a0e6.tar.gz
vaadin-framework-5020466294352484f75fbe64658ec79f6aa7a0e6.zip
Make Vaadin component handling proxy-friendly (#14639)
Comparisons with the ==-operator between a proxy and it's underlying instance fail, so we should use a custom equals method instead. Change-Id: Iaa86ae830fecbedfb1f55636e25f5affebf5aba3
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractOrderedLayout.java')
-rw-r--r--server/src/com/vaadin/ui/AbstractOrderedLayout.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
index 27880db75f..638f6bc3f9 100644
--- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
@@ -105,7 +105,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
public void addComponentAsFirst(Component c) {
// If c is already in this, we must remove it before proceeding
// see ticket #7668
- if (c.getParent() == this) {
+ if (equals(c.getParent())) {
removeComponent(c);
}
components.addFirst(c);
@@ -131,7 +131,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
public void addComponent(Component c, int index) {
// If c is already in this, we must remove it before proceeding
// see ticket #7668
- if (c.getParent() == this) {
+ if (equals(c.getParent())) {
// When c is removed, all components after it are shifted down
if (index > getComponentIndex(c)) {
index--;