diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-07-26 10:37:06 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-07-26 10:37:06 +0300 |
commit | df430157bf12ae88e265318c09250a3865981a0c (patch) | |
tree | 8c08132845871664e1bdca398092d7a96833661b | |
parent | bcbb2c10efec9e27515e474f78d7371082042884 (diff) | |
download | vaadin-framework-df430157bf12ae88e265318c09250a3865981a0c.tar.gz vaadin-framework-df430157bf12ae88e265318c09250a3865981a0c.zip |
Don't throw UnsupportedOperationException in Label.toString (#9175)
-rw-r--r-- | src/com/vaadin/ui/Label.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java index e7ca26faf8..00137f67e1 100644 --- a/src/com/vaadin/ui/Label.java +++ b/src/com/vaadin/ui/Label.java @@ -5,6 +5,7 @@ package com.vaadin.ui; import java.lang.reflect.Method; +import java.util.logging.Logger; import com.vaadin.data.Property; import com.vaadin.data.util.converter.Converter; @@ -41,6 +42,9 @@ public class Label extends AbstractComponent implements Property<String>, Property.Viewer, Property.ValueChangeListener, Property.ValueChangeNotifier, Comparable<Label> { + private static final Logger logger = Logger + .getLogger(Label.class.getName()); + /** * @deprecated From 7.0, use {@link ContentMode#TEXT} instead */ @@ -184,14 +188,20 @@ public class Label extends AbstractComponent implements Property<String>, } /** + * Returns the value displayed by this label. + * * @see java.lang.Object#toString() - * @deprecated Use {@link #getValue()} instead + * @deprecated As of 7.0.0, use {@link #getValue()} to get the value of the + * label or {@link #getPropertyDataSource()} .getValue() to get + * the value of the data source. */ @Deprecated @Override public String toString() { - throw new UnsupportedOperationException( - "Use getValue() instead of Label.toString()"); + logger.warning("You are using Label.toString() to get the value for a " + + getClass().getSimpleName() + + ". This is not recommended and will not be supported in future versions."); + return getValue(); } /** |