summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-05-10 15:30:56 +0300
committerHenri Sara <henri.sara@gmail.com>2017-05-16 15:35:17 +0300
commit2e879d11f8b052bd95a84ffbeac47f65afff3a89 (patch)
treee2f237ca69b6c8f2ab9763a73748fc3916be4550
parentc9dbc70ac7108cf7bdfe43c907dc3ae95efa12c6 (diff)
downloadvaadin-framework-2e879d11f8b052bd95a84ffbeac47f65afff3a89.tar.gz
vaadin-framework-2e879d11f8b052bd95a84ffbeac47f65afff3a89.zip
Remove redundant method getComponentCount from Composite
-rw-r--r--server/src/main/java/com/vaadin/ui/Composite.java11
1 files changed, 1 insertions, 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");
}