diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-03-24 10:47:47 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2015-03-24 10:47:47 +0200 |
commit | 3306d80f14cebaee7ddcc50df74708783da86868 (patch) | |
tree | 6a8c2d0f9ca8f3a02b1c13a084e86b7e286303b5 | |
parent | e70763f4b3f6b2faef598bc7f138d9b0c0e18d8e (diff) | |
download | vaadin-framework-3306d80f14cebaee7ddcc50df74708783da86868.tar.gz vaadin-framework-3306d80f14cebaee7ddcc50df74708783da86868.zip |
Revert "Fix Declarative support for BigDecimal properties (#17205)"
This reverts commit 4a40924cd8715f664cf08ea6bfff7c83d96d14d4.
-rw-r--r-- | server/src/com/vaadin/ui/declarative/DesignFormatter.java | 15 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java | 16 |
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)); |