diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java index 7b42535d213..78813bded8e 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java @@ -471,6 +471,14 @@ public final class BeanWrapperGenericsTests { Assert.assertEquals(new Integer(30), gb.getGenericListProperty().get(1).iterator().next()); } + @Test + public void testSettingGenericPropertyWithReadOnlyInterface() { + Bar bar = new Bar(); + BeanWrapper bw = new BeanWrapperImpl(bar); + bw.setPropertyValue("version", "10"); + Assert.assertEquals(10.0, bar.getVersion()); + } + private static abstract class BaseGenericCollectionBean { @@ -565,4 +573,25 @@ public final class BeanWrapperGenericsTests { } + + public interface Foo { + + Number getVersion(); + } + + + public class Bar implements Foo { + + private double version; + + public Double getVersion() { + return this.version; + } + + public void setVersion(Double theDouble) { + this.version = theDouble; + } + } + + }