From 2d157db090cf7bfef0519dc372bab94d5852cc80 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 22 Dec 2011 14:13:11 +0200 Subject: [PATCH] Print type info when an illegal type is passed to setValue --- src/com/vaadin/data/util/ObjectProperty.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/vaadin/data/util/ObjectProperty.java b/src/com/vaadin/data/util/ObjectProperty.java index 40e25dca89..9c60b9146e 100644 --- a/src/com/vaadin/data/util/ObjectProperty.java +++ b/src/com/vaadin/data/util/ObjectProperty.java @@ -125,8 +125,9 @@ public class ObjectProperty extends AbstractProperty { // Checks the type of the value if (newValue != null && !type.isAssignableFrom(newValue.getClass())) { - throw new IllegalArgumentException( - "Invalid value type for ObjectProperty."); + throw new IllegalArgumentException("Invalid value type " + + newValue.getClass().getName() + + " for ObjectProperty of type " + type.getName() + "."); } // the cast is safe after an isAssignableFrom check -- 2.39.5