|
35 | 35 |
|
36 | 36 | /** |
37 | 37 | * @author Chris Beams |
| 38 | + * @author Juergen Hoeller |
| 39 | + * @author Sam Brannen |
38 | 40 | * @since 3.1 |
39 | 41 | */ |
40 | 42 | public class ExtendedBeanInfoTests { |
@@ -834,32 +836,26 @@ public boolean isTargetMethod() { |
834 | 836 | } |
835 | 837 |
|
836 | 838 | @Test |
837 | | - public void cornerSpr8937() throws IntrospectionException { |
| 839 | + public void cornerSpr8937AndSpr12582() throws IntrospectionException { |
838 | 840 | @SuppressWarnings("unused") class A { |
839 | 841 | public void setAddress(String addr){ } |
840 | 842 | public void setAddress(int index, String addr) { } |
841 | 843 | public String getAddress(int index){ return null; } |
842 | 844 | } |
843 | 845 |
|
844 | | - // Baseline: ExtendedBeanInfo needs to behave exactly like the following... |
845 | | - boolean hasReadMethod; |
846 | | - boolean hasWriteMethod; |
847 | | - boolean hasIndexedReadMethod; |
848 | | - boolean hasIndexedWriteMethod; |
849 | | - { |
850 | | - BeanInfo bi = Introspector.getBeanInfo(A.class); |
851 | | - hasReadMethod = hasReadMethodForProperty(bi, "address"); |
852 | | - hasWriteMethod = hasWriteMethodForProperty(bi, "address"); |
853 | | - hasIndexedReadMethod = hasIndexedReadMethodForProperty(bi, "address"); |
854 | | - hasIndexedWriteMethod = hasIndexedWriteMethodForProperty(bi, "address"); |
855 | | - } |
856 | | - { |
857 | | - BeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(A.class)); |
858 | | - assertEquals(hasReadMethodForProperty(bi, "address"), hasReadMethod); |
859 | | - assertEquals(hasWriteMethodForProperty(bi, "address"), hasWriteMethod); |
860 | | - assertEquals(hasIndexedReadMethodForProperty(bi, "address"), hasIndexedReadMethod); |
861 | | - assertEquals(hasIndexedWriteMethodForProperty(bi, "address"), hasIndexedWriteMethod); |
862 | | - } |
| 846 | + // Baseline: |
| 847 | + BeanInfo bi = Introspector.getBeanInfo(A.class); |
| 848 | + boolean hasReadMethod = hasReadMethodForProperty(bi, "address"); |
| 849 | + boolean hasWriteMethod = hasWriteMethodForProperty(bi, "address"); |
| 850 | + boolean hasIndexedReadMethod = hasIndexedReadMethodForProperty(bi, "address"); |
| 851 | + boolean hasIndexedWriteMethod = hasIndexedWriteMethodForProperty(bi, "address"); |
| 852 | + |
| 853 | + // ExtendedBeanInfo needs to behave exactly like BeanInfo... |
| 854 | + BeanInfo ebi = new ExtendedBeanInfo(bi); |
| 855 | + assertEquals(hasReadMethod, hasReadMethodForProperty(ebi, "address")); |
| 856 | + assertEquals(hasWriteMethod, hasWriteMethodForProperty(ebi, "address")); |
| 857 | + assertEquals(hasIndexedReadMethod, hasIndexedReadMethodForProperty(ebi, "address")); |
| 858 | + assertEquals(hasIndexedWriteMethod, hasIndexedWriteMethodForProperty(ebi, "address")); |
863 | 859 | } |
864 | 860 |
|
865 | 861 | @Test |
|
0 commit comments