summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorMaciej PrzepioĢra <mac@vaadin.com>2016-04-28 16:34:33 +0300
committerVaadin Code Review <review@vaadin.com>2016-05-03 10:16:46 +0000
commitdb19b40724d0012697d04e3e70311347a563e9ee (patch)
tree553b963b69d5ec433a564186775784cc4b482d5c /server/src
parentd1bd111c4effde09d3457606866ef4d6ea92b7dd (diff)
downloadvaadin-framework-db19b40724d0012697d04e3e70311347a563e9ee.tar.gz
vaadin-framework-db19b40724d0012697d04e3e70311347a563e9ee.zip
Throw IAE in setExpandRatio() if given ratio is less than 0
Change-Id: Ie7f92edea210c54400f6dce38e1376e3c0eae575
Diffstat (limited to 'server/src')
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
index f517ab0af5..d6df3f372a 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
@@ -328,6 +328,10 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
* @param component
* the component in this layout which expand ratio is to be set
* @param ratio
+ * new expand ratio (greater or equal to 0)
+ * @throws IllegalArgumentException
+ * if the expand ratio is negative or the component is not a
+ * direct child of the layout
*/
public void setExpandRatio(Component component, float ratio) {
ChildComponentData childData = getState().childData.get(component);
@@ -335,6 +339,10 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
throw new IllegalArgumentException(
"The given component is not a child of this layout");
}
+ if (ratio < 0.0f) {
+ throw new IllegalArgumentException(
+ "Expand ratio can't be less than 0.0");
+ }
childData.expandRatio = ratio;
}