From 2e879d11f8b052bd95a84ffbeac47f65afff3a89 Mon Sep 17 00:00:00 2001 From: Aleksi Hietanen Date: Wed, 10 May 2017 15:30:56 +0300 Subject: Remove redundant method getComponentCount from Composite --- server/src/main/java/com/vaadin/ui/Composite.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/server/src/main/java/com/vaadin/ui/Composite.java b/server/src/main/java/com/vaadin/ui/Composite.java index ed0db20f07..3c1e9b03cc 100644 --- a/server/src/main/java/com/vaadin/ui/Composite.java +++ b/server/src/main/java/com/vaadin/ui/Composite.java @@ -127,15 +127,6 @@ public class Composite extends AbstractComponent implements HasComponents { } } - /** - * Gets the number of contained components. - * - * @return the number of contained components (zero or one) - */ - public int getComponentCount() { - return (getCompositionRoot() != null ? 1 : 0); - } - @Override protected CompositeState getState() { return (CompositeState) super.getState(); @@ -149,7 +140,7 @@ public class Composite extends AbstractComponent implements HasComponents { @Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); - if (getComponentCount() != 1) { + if (getCompositionRoot() == null) { throw new IllegalStateException( "A composite must always have a composition root"); } -- cgit v1.2.3