harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r999787 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/beans/src/main/java/java/beans/ classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ drlvm/ jdktools/
Date Wed, 22 Sep 2010 07:48:55 GMT
Author: hindessm
Date: Wed Sep 22 07:48:55 2010
New Revision: 999787

URL: http://svn.apache.org/viewvc?rev=999787&view=rev
Log:
Merge change from /harmony/enhanced/java/trunk@998628:

  r998628 | zhoukevin | 2010-09-19 11:19:56 +0100 (Sun, 19 Sep 2010) | 4 lines
  
  This patch fixes 2 defects [1] [2] in Beans module caused by java.beans.StandardBeanInfo
class.
  [1] If a bean class has "public boolean isProperty(int)" and "public boolean getProperty(int)"
methods, RI takes getProperty(int) as read method of this "property", while HARMONY takes
isProperty(int) method
  [2] If a bean class has "public boolean isProperty(int)" and "public void setProperty(int,
boolean)" methods, HARMONY fails to find this "property" while RI finds it and only regards
setProperty(int, boolean) as its write method.
  Moreover, this patch includes 17 test cases to reflect those problems.


Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
    harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 07:48:55 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-997624,997759,997980,997986,998010,998030,998619
+/harmony/enhanced/java/trunk:929253-997624,997759,997980,997986,998010,998030,998619,998628
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 07:48:55 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-997624,997759,997980,997986,998010,998030,998619
+/harmony/enhanced/java/trunk/classlib:929253-997624,997759,997980,997986,998010,998030,998619,998628
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 07:48:55 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-997624,997759,997980,997986,998010,998030,998619
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-997624,997759,997980,997986,998010,998030,998619,998628
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/StandardBeanInfo.java?rev=999787&r1=999786&r2=999787&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
Wed Sep 22 07:48:55 2010
@@ -985,24 +985,28 @@ class StandardBeanInfo extends SimpleBea
             }
 
             // retrieve getters
+            Class<?>[] paramTypes = null;
+            String methodName = null;
             for (Method getter : getters) {
+                paramTypes = getter.getParameterTypes();
+                methodName = getter.getName();
                 // checks if it's a normal getter
-                if (getter.getParameterTypes() == null
-                        || getter.getParameterTypes().length == 0) {
+                if (paramTypes == null || paramTypes.length == 0) {
                     // normal getter found
                     if (normalGetter == null
-                            || getter.getName().startsWith(PREFIX_IS)) {
+                            || methodName.startsWith(PREFIX_IS)) {
                         normalGetter = getter;
                     }
                 }
 
                 // checks if it's an indexed getter
-                if (getter.getParameterTypes() != null
-                        && getter.getParameterTypes().length == 1
-                        && getter.getParameterTypes()[0] == int.class) {
+                if (paramTypes != null && paramTypes.length == 1
+                        && paramTypes[0] == int.class) {
                     // indexed getter found
                     if (indexedGetter == null
-                            || getter.getName().startsWith(PREFIX_IS)) {
+                            || methodName.startsWith(PREFIX_GET)
+                            || (methodName.startsWith(PREFIX_IS) && !indexedGetter
+                                    .getName().startsWith(PREFIX_GET))) {
                         indexedGetter = getter;
                     }
                 }
@@ -1251,6 +1255,12 @@ class StandardBeanInfo extends SimpleBea
                     && (indexedGetter != null || indexedSetter != null)) {
                 if (indexedGetter != null
                         && indexedGetter.getName().startsWith(PREFIX_IS)) {
+                    if (indexedSetter != null) {
+                        table.put(STR_INDEXED, STR_VALID);
+                        table.put(STR_INDEXED + PREFIX_SET, indexedSetter);
+                        table.put(STR_INDEXED + STR_PROPERTY_TYPE,
+                                indexedPropType);
+                    }
                     continue;
                 }
                 table.put(STR_INDEXED, STR_VALID);

Modified: harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?rev=999787&r1=999786&r2=999787&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
Wed Sep 22 07:48:55 2010
@@ -4117,6 +4117,512 @@ public class IntrospectorTest extends Te
         }
     }
 
+    public class MixedSimpleClass45 {
+        public boolean isList(int index) {
+            return true;
+        }
+    }
+
+    public void test_MixedSimpleClass45() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass45.class);
+        assertEquals(1, beanInfo.getPropertyDescriptors().length);
+    }
+
+    public class MixedSimpleClass46 {
+        public boolean getList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+    }
+
+    public void test_MixedSimpleClass46() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass46.class);
+        Method getter = MixedSimpleClass46.class.getMethod("getList",
+                new Class<?>[] {});
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass47 {
+        public boolean isList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+    }
+
+    public void test_MixedSimpleClass47() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass47.class);
+        Method getter = MixedSimpleClass47.class.getMethod("isList",
+                new Class<?>[] {});
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass48 {
+        public boolean getList(int index) {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+    }
+
+    public void test_MixedSimpleClass48() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass48.class);
+        Method getter = MixedSimpleClass48.class.getMethod("getList",
+                new Class<?>[] { int.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertEquals(getter,
+                        ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass49 {
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass49() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass49.class);
+        Method setter = MixedSimpleClass49.class.getMethod("setList",
+                new Class<?>[] { boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertEquals(setter, pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass50 {
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(int index, boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass50() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass50.class);
+        Method setter = MixedSimpleClass50.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass51 {
+        public boolean getList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass51() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass51.class);
+        Method getter = MixedSimpleClass51.class.getMethod("getList",
+                new Class<?>[] {});
+        Method setter = MixedSimpleClass51.class.getMethod("setList",
+                new Class<?>[] { boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertEquals(setter, pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass52 {
+        public boolean getList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(int index, boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass52() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass52.class);
+        Method setter = MixedSimpleClass52.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass53 {
+        public boolean isList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass53() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass53.class);
+        Method getter = MixedSimpleClass53.class.getMethod("isList",
+                new Class<?>[] {});
+        Method setter = MixedSimpleClass53.class.getMethod("setList",
+                new Class<?>[] { boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertEquals(setter, pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass54 {
+        public boolean isList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(int index, boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass54() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass54.class);
+        Method setter = MixedSimpleClass54.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass55 {
+        public boolean getList(int index) {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass55() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass55.class);
+        Method getter = MixedSimpleClass55.class.getMethod("getList",
+                new Class<?>[] { int.class });
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertEquals(getter,
+                        ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass56 {
+        public boolean getList(int index) {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(int index, boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass56() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass56.class);
+        Method getter = MixedSimpleClass56.class.getMethod("getList",
+                new Class<?>[] { int.class });
+        Method setter = MixedSimpleClass56.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertEquals(getter,
+                        ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass57 {
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+
+        }
+
+        public void setList(int index, boolean bool) {
+        }
+    }
+
+    public void test_MixedSimpleClass57() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass57.class);
+        Method setter = MixedSimpleClass57.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertNull(((IndexedPropertyDescriptor) pd)
+                        .getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass58 {
+        public boolean getList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+
+        public void setList(int index, boolean bool) {
+
+        }
+    }
+
+    public void test_MixedSimpleClass58() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass58.class);
+        Method getter = MixedSimpleClass58.class.getMethod("getList",
+                new Class<?>[] {});
+        Method setter = MixedSimpleClass58.class.getMethod("setList",
+                new Class<?>[] { boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertEquals(setter, pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass59 {
+        public boolean isList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+
+        public void setList(int index, boolean bool) {
+
+        }
+    }
+
+    public void test_MixedSimpleClass59() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass59.class);
+        Method getter = MixedSimpleClass59.class.getMethod("isList",
+                new Class<?>[] {});
+        Method setter = MixedSimpleClass59.class.getMethod("setList",
+                new Class<?>[] { boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertEquals(getter, pd.getReadMethod());
+                assertEquals(setter, pd.getWriteMethod());
+                assertFalse(pd instanceof IndexedPropertyDescriptor);
+            }
+        }
+    }
+
+    public class MixedSimpleClass60 {
+        public boolean getList(int index) {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+
+        public void setList(int index, boolean bool) {
+
+        }
+    }
+
+    public void test_MixedSimpleClass60() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass60.class);
+        Method getter = MixedSimpleClass60.class.getMethod("getList",
+                new Class<?>[] { int.class });
+        Method setter = MixedSimpleClass60.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertEquals(getter,
+                        ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
+    public class MixedSimpleClass61 {
+        public boolean getList() {
+            return true;
+        }
+
+        public boolean getList(int index) {
+            return true;
+        }
+
+        public boolean isList() {
+            return true;
+        }
+
+        public boolean isList(int index) {
+            return true;
+        }
+
+        public void setList(boolean bool) {
+        }
+
+        public void setList(int index, boolean bool) {
+
+        }
+    }
+
+    public void test_MixedSimpleClass61() throws Exception {
+        BeanInfo beanInfo = Introspector.getBeanInfo(MixedSimpleClass61.class);
+        Method getter = MixedSimpleClass61.class.getMethod("getList",
+                new Class<?>[] { int.class });
+        Method setter = MixedSimpleClass61.class.getMethod("setList",
+                new Class<?>[] { int.class, boolean.class });
+        assertEquals(2, beanInfo.getPropertyDescriptors().length);
+        for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
+            if (propertyName.equals(pd.getName())) {
+                assertNull(pd.getReadMethod());
+                assertNull(pd.getWriteMethod());
+                assertTrue(pd instanceof IndexedPropertyDescriptor);
+                assertEquals(getter,
+                        ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
+                assertEquals(setter,
+                        ((IndexedPropertyDescriptor) pd)
+                                .getIndexedWriteMethod());
+            }
+        }
+    }
+
     public class MixedExtendClass1 extends MixedSimpleClass4 {
         public void setList(Object a) {
 

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 07:48:55 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-997624,997759,997980,997986,998010,998030,998619
+/harmony/enhanced/java/trunk/drlvm:929253-997624,997759,997980,997986,998010,998030,998619,998628
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 22 07:48:55 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-997624,997759,997980,997986,998010,998030,998619
+/harmony/enhanced/java/trunk/jdktools:929253-997624,997759,997980,997986,998010,998030,998619,998628
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147



Mime
View raw message