diff options
author | Artur Signell <artur@vaadin.com> | 2012-10-01 14:08:33 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-10-01 14:10:02 +0300 |
commit | 0e3b55601457da2d5bc9edb85d2de701409aeb5c (patch) | |
tree | 60de7683e756592418449fab80cb8fa52c9a60c1 /server/src/com/vaadin/data/util/IndexedContainer.java | |
parent | 4a9daa9edda206840aef12732606608587ce05ac (diff) | |
download | vaadin-framework-0e3b55601457da2d5bc9edb85d2de701409aeb5c.tar.gz vaadin-framework-0e3b55601457da2d5bc9edb85d2de701409aeb5c.zip |
Avoid throwing exceptions from toString, log message instead (#9804)
Change-Id: Ia2f8504a0fe75ab3a7c4746d533e5fd012e2a69c
Diffstat (limited to 'server/src/com/vaadin/data/util/IndexedContainer.java')
-rw-r--r-- | server/src/com/vaadin/data/util/IndexedContainer.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/src/com/vaadin/data/util/IndexedContainer.java b/server/src/com/vaadin/data/util/IndexedContainer.java index e957d958a9..7273b28b66 100644 --- a/server/src/com/vaadin/data/util/IndexedContainer.java +++ b/server/src/com/vaadin/data/util/IndexedContainer.java @@ -28,6 +28,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.logging.Logger; import com.vaadin.data.Container; import com.vaadin.data.Item; @@ -961,8 +962,21 @@ public class IndexedContainer extends @Deprecated @Override public String toString() { - throw new UnsupportedOperationException( - "Use Property.getValue() instead of IndexedContainerProperty.toString()"); + getLogger() + .warning( + "You are using IndexedContainerProperty.toString() instead of getValue() to get the value for a " + + getClass().getSimpleName() + + ". This will not be supported starting from Vaadin 7.1 " + + "(your debugger might call toString() and cause this message to appear)."); + Object v = getValue(); + if (v == null) { + return null; + } + return v.toString(); + } + + private Logger getLogger() { + return Logger.getLogger(IndexedContainerProperty.class.getName()); } /** |