diff options
author | Artur Signell <artur@vaadin.com> | 2011-12-22 22:23:14 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2011-12-22 23:17:20 +0200 |
commit | ed6fd1705050f6d3c552a27e90388f4423857524 (patch) | |
tree | 4c8ec00c45b38c2855aae937ae6eab22d3e99034 /src/com/vaadin/data/util | |
parent | 0f2cb7d64e1296dc364056d52b9c5adc637adbb6 (diff) | |
download | vaadin-framework-ed6fd1705050f6d3c552a27e90388f4423857524.tar.gz vaadin-framework-ed6fd1705050f6d3c552a27e90388f4423857524.zip |
Corrected error message to show model and not presentation type when
conversion fails
Diffstat (limited to 'src/com/vaadin/data/util')
4 files changed, 5 insertions, 5 deletions
diff --git a/src/com/vaadin/data/util/converter/StringToBooleanConverter.java b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java index 1913266db2..3b2034a361 100644 --- a/src/com/vaadin/data/util/converter/StringToBooleanConverter.java +++ b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java @@ -41,8 +41,8 @@ public class StringToBooleanConverter implements Converter<String, Boolean> { } else if (getFalseString().equals(value)) {
return false;
} else {
- throw new ConversionException("Cannot convert " + value
- + " to Boolean");
+ throw new ConversionException("Cannot convert " + value + " to "
+ + getModelType().getName());
}
}
diff --git a/src/com/vaadin/data/util/converter/StringToDateConverter.java b/src/com/vaadin/data/util/converter/StringToDateConverter.java index 96b144f6ea..2aa9395532 100644 --- a/src/com/vaadin/data/util/converter/StringToDateConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDateConverter.java @@ -65,7 +65,7 @@ public class StringToDateConverter implements Converter<String, Date> { Date parsedValue = getFormat(locale).parse(value, parsePosition);
if (parsePosition.getIndex() != value.length()) {
throw new ConversionException("Could not convert '" + value
- + "' to " + getPresentationType().getName());
+ + "' to " + getModelType().getName());
}
return parsedValue;
diff --git a/src/com/vaadin/data/util/converter/StringToDoubleConverter.java b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java index d9441422ad..29c6329451 100644 --- a/src/com/vaadin/data/util/converter/StringToDoubleConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java @@ -62,7 +62,7 @@ public class StringToDoubleConverter implements Converter<String, Double> { Number parsedValue = getFormat(locale).parse(value, parsePosition);
if (parsePosition.getIndex() != value.length()) {
throw new ConversionException("Could not convert '" + value
- + "' to " + getPresentationType().getName());
+ + "' to " + getModelType().getName());
}
return parsedValue.doubleValue();
}
diff --git a/src/com/vaadin/data/util/converter/StringToNumberConverter.java b/src/com/vaadin/data/util/converter/StringToNumberConverter.java index c71b7180e9..64944a434c 100644 --- a/src/com/vaadin/data/util/converter/StringToNumberConverter.java +++ b/src/com/vaadin/data/util/converter/StringToNumberConverter.java @@ -60,7 +60,7 @@ public class StringToNumberConverter implements Converter<String, Number> { Number parsedValue = getFormat(locale).parse(value, parsePosition);
if (parsePosition.getIndex() != value.length()) {
throw new ConversionException("Could not convert '" + value
- + "' to " + getPresentationType().getName());
+ + "' to " + getModelType().getName());
}
if (parsedValue == null) {
|