From: John Alhroos Date: Wed, 27 Apr 2011 11:30:16 +0000 (+0000) Subject: Simplified if-else conditional for actions #5992 X-Git-Tag: 6.7.0.beta1~252 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e1732482bc62587e9db723fa25df06d8110f112;p=vaadin-framework.git Simplified if-else conditional for actions #5992 svn changeset:18494/svn branch:6.6 --- diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index f0416a2059..b14df2cdaa 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -2151,18 +2151,12 @@ public class Table extends AbstractSelect implements Action.Container, if (st.countTokens() == 2) { final Object itemId = itemIdMapper.get(st.nextToken()); final Action action = (Action) actionMapper.get(st.nextToken()); - if (action != null && containsId(itemId) + + if (action != null && (itemId == null || containsId(itemId)) && actionHandlers != null) { - // Item action for (Handler ah : actionHandlers) { ah.handleAction(action, this, itemId); } - } else if (action != null && actionHandlers != null - && itemId == null) { - // Body action - for (Handler ah : actionHandlers) { - ah.handleAction(action, this, null); - } } } }