]> source.dussan.org Git - vaadin-framework.git/commit
Modified the logic in setPropertyDatasource which determines if a new converter is...
authorArtur Signell <artur@vaadin.com>
Tue, 21 May 2013 13:51:32 +0000 (16:51 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 22 May 2013 13:50:40 +0000 (13:50 +0000)
commit6bf83a428aa747f6b46d1d4c4ad2e279971d14e7
tree2120465ccf24b83acf01ba6c829c4fe59866b74b
parent0b635061bb9b30e9f28d49fe9606eb3cab2fd3f1
Modified the logic in setPropertyDatasource which determines if a new converter is needed (#11863)

The previous logic had two flaws
* It allowed converter model type to be a sub type of the model type but not vice versa. Similarly for presentation type.
* If the user has set a converter it should be used and not be replaced unless it is absolutely sure that it cannot in any possible way handle conversion (e.g. converter from integer to double cannot handle string to list conversion). If there is a slight chance that it can handle conversion, let it be and let the user set another converter when needed.

Change-Id: I2e1c0b3aac90be63ddbc780195f8428398e28ada
server/src/com/vaadin/data/util/converter/ConverterUtil.java
server/src/com/vaadin/ui/AbstractField.java
server/src/com/vaadin/ui/Label.java
server/tests/src/com/vaadin/tests/data/converter/AnotherTestEnum.java [new file with mode: 0644]
server/tests/src/com/vaadin/tests/data/converter/TestAnyEnumToStringConverter.java [new file with mode: 0644]
server/tests/src/com/vaadin/tests/data/converter/TestEnum.java [new file with mode: 0644]
server/tests/src/com/vaadin/tests/data/converter/TestSpecificEnumToStringConverter.java [new file with mode: 0644]