]> source.dussan.org Git - vaadin-framework.git/commitdiff
Corrected error message to show model and not presentation type when
authorArtur Signell <artur@vaadin.com>
Thu, 22 Dec 2011 20:23:14 +0000 (22:23 +0200)
committerArtur Signell <artur@vaadin.com>
Thu, 22 Dec 2011 21:17:20 +0000 (23:17 +0200)
conversion fails

src/com/vaadin/data/util/converter/StringToBooleanConverter.java
src/com/vaadin/data/util/converter/StringToDateConverter.java
src/com/vaadin/data/util/converter/StringToDoubleConverter.java
src/com/vaadin/data/util/converter/StringToNumberConverter.java

index 1913266db2d2494aaff0b31c9a17f4a02cd77fd8..3b2034a3614900cb9e17843ce91c84981b80c882 100644 (file)
@@ -41,8 +41,8 @@ public class StringToBooleanConverter implements Converter<String, Boolean> {
         } else if (getFalseString().equals(value)) {\r
             return false;\r
         } else {\r
-            throw new ConversionException("Cannot convert " + value\r
-                    + " to Boolean");\r
+            throw new ConversionException("Cannot convert " + value + " to "\r
+                    + getModelType().getName());\r
         }\r
     }\r
 \r
index 96b144f6ea971c29c8a3e255b9c0b9e7fd33b38b..2aa939553238f8af0a1d679cc4c4621877921d0b 100644 (file)
@@ -65,7 +65,7 @@ public class StringToDateConverter implements Converter<String, Date> {
         Date parsedValue = getFormat(locale).parse(value, parsePosition);\r
         if (parsePosition.getIndex() != value.length()) {\r
             throw new ConversionException("Could not convert '" + value\r
-                    + "' to " + getPresentationType().getName());\r
+                    + "' to " + getModelType().getName());\r
         }\r
 \r
         return parsedValue;\r
index d9441422adb483b55d2b875da3d06db566846ec5..29c632945134695fce05903f4d5ec3792de32a3f 100644 (file)
@@ -62,7 +62,7 @@ public class StringToDoubleConverter implements Converter<String, Double> {
         Number parsedValue = getFormat(locale).parse(value, parsePosition);\r
         if (parsePosition.getIndex() != value.length()) {\r
             throw new ConversionException("Could not convert '" + value\r
-                    + "' to " + getPresentationType().getName());\r
+                    + "' to " + getModelType().getName());\r
         }\r
         return parsedValue.doubleValue();\r
     }\r
index c71b7180e99528a070931be32055331833ce7b01..64944a434c1a881ad8496fd31ab51c3329ef8a2c 100644 (file)
@@ -60,7 +60,7 @@ public class StringToNumberConverter implements Converter<String, Number> {
         Number parsedValue = getFormat(locale).parse(value, parsePosition);\r
         if (parsePosition.getIndex() != value.length()) {\r
             throw new ConversionException("Could not convert '" + value\r
-                    + "' to " + getPresentationType().getName());\r
+                    + "' to " + getModelType().getName());\r
         }\r
 \r
         if (parsedValue == null) {\r