aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/ui/declarative/DesignFormatter.java15
-rw-r--r--server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java16
2 files changed, 5 insertions, 26 deletions
diff --git a/server/src/com/vaadin/ui/declarative/DesignFormatter.java b/server/src/com/vaadin/ui/declarative/DesignFormatter.java
index 728b3d1077..cc5071fe9d 100644
--- a/server/src/com/vaadin/ui/declarative/DesignFormatter.java
+++ b/server/src/com/vaadin/ui/declarative/DesignFormatter.java
@@ -29,7 +29,6 @@ import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import com.vaadin.data.util.converter.Converter;
-import com.vaadin.data.util.converter.StringToBigDecimalConverter;
import com.vaadin.data.util.converter.StringToDoubleConverter;
import com.vaadin.data.util.converter.StringToFloatConverter;
import com.vaadin.event.ShortcutAction;
@@ -69,8 +68,8 @@ public class DesignFormatter implements Serializable {
*/
protected void mapDefaultTypes() {
// numbers use standard toString/valueOf approach
- for (Class<?> c : new Class<?>[] { Byte.class, Short.class,
- Integer.class, Long.class }) {
+ for (Class<?> c : new Class<?>[] { Integer.class, Byte.class,
+ Short.class, Long.class, BigDecimal.class }) {
DesignToStringConverter<?> conv = new DesignToStringConverter(c);
converterMap.put(c, conv);
try {
@@ -135,16 +134,6 @@ public class DesignFormatter implements Serializable {
converterMap.put(Double.class, doubleConverter);
converterMap.put(double.class, doubleConverter);
- final DecimalFormat bigDecimalFmt = new DecimalFormat("0.###", symbols);
- bigDecimalFmt.setGroupingUsed(false);
- bigDecimalFmt.setParseBigDecimal(true);
- converterMap.put(BigDecimal.class, new StringToBigDecimalConverter() {
- @Override
- protected NumberFormat getFormat(Locale locale) {
- return bigDecimalFmt;
- };
- });
-
// strings do nothing
converterMap.put(String.class, new Converter<String, String>() {
diff --git a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
index 05b2484767..1e6d446427 100644
--- a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
+++ b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java
@@ -18,7 +18,6 @@ package com.vaadin.tests.design;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
@@ -58,10 +57,9 @@ public class DesignFormatterTest {
byte.class, short.class, int.class, long.class, float.class,
double.class, Boolean.class, Character.class, Byte.class,
Short.class, Integer.class, Long.class, Float.class,
- Double.class, BigDecimal.class, String.class,
- ShortcutAction.class, Date.class, FileResource.class,
- ExternalResource.class, ThemeResource.class, Resource.class,
- TimeZone.class }) {
+ Double.class, String.class, ShortcutAction.class, Date.class,
+ FileResource.class, ExternalResource.class,
+ ThemeResource.class, Resource.class, TimeZone.class }) {
assertTrue("not supported " + type.getSimpleName(),
formatter.canConvert(type));
}
@@ -147,14 +145,6 @@ public class DesignFormatterTest {
}
@Test
- public void testBigDecimal() {
- BigDecimal bd = new BigDecimal("123456789123456789.123456789123456789");
- assertEquals("123456789123456789.123", formatter.format(bd));
- assertEquals(bd, formatter.parse(
- "123456789123456789.123456789123456789", BigDecimal.class));
- }
-
- @Test
public void testChar() {
char c = '\uABCD';
assertEquals("\uABCD", formatter.format(c));