diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-10-19 14:54:33 +0300 |
---|---|---|
committer | Denis Anisimov <denis@vaadin.com> | 2016-10-25 10:19:36 +0300 |
commit | 63d218efc0ee5825633b4950e3355f4e8cc7bc29 (patch) | |
tree | b43fc989aded9041b3894714105ce43385798064 /server/src/main/java/com/vaadin/ui/RichTextArea.java | |
parent | 862270140d287aba33dce03dc963db4421ebeb1a (diff) | |
download | vaadin-framework-63d218efc0ee5825633b4950e3355f4e8cc7bc29.tar.gz vaadin-framework-63d218efc0ee5825633b4950e3355f4e8cc7bc29.zip |
Fix setValue() methods behavior null argument value + javadocs
Change-Id: I0000c1caf7c129634473161fe4876931f3c8dabf
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/RichTextArea.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/RichTextArea.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/server/src/main/java/com/vaadin/ui/RichTextArea.java b/server/src/main/java/com/vaadin/ui/RichTextArea.java index 545166d33a..96a639e285 100644 --- a/server/src/main/java/com/vaadin/ui/RichTextArea.java +++ b/server/src/main/java/com/vaadin/ui/RichTextArea.java @@ -16,6 +16,8 @@ package com.vaadin.ui; +import java.util.Objects; + import org.jsoup.nodes.Element; import com.vaadin.shared.ui.ValueChangeMode; @@ -100,13 +102,20 @@ public class RichTextArea extends AbstractField<String> return (RichTextAreaState) super.getState(markAsDirty); } + /** + * Sets the value of this object. If the new value is not equal to + * {@code getValue()}, fires a {@link ValueChangeEvent}. Throws + * {@code NullPointerException} if the value is null. + * + * @param value + * the new value, not {@code null} + * @throws NullPointerException + * if {@code value} is {@code null} + */ @Override public void setValue(String value) { - if (value == null) { - setValue("", false); - } else { - setValue(value, false); - } + Objects.requireNonNull(value, "value cannot be null"); + setValue(value, false); } @Override |