harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r557200 - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/StandardBeanInfo.java test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
Date Wed, 18 Jul 2007 08:51:49 GMT
Author: tonywu
Date: Wed Jul 18 01:51:48 2007
New Revision: 557200

URL: http://svn.apache.org/viewvc?view=rev&rev=557200
Log:
RI sets the property to unbound by default 

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java?view=diff&rev=557200&r1=557199&r2=557200
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
Wed Jul 18 01:51:48 2007
@@ -577,8 +577,8 @@
                             null, null, indexedGet, indexedSet);
                 }
             }
-            //RI set propretyDescriptor as bound.
-            propertyDesc.setBound(true);
+            //RI set propretyDescriptor as bound. FIXME
+            propertyDesc.setBound(false);
             propertyList.add(propertyDesc);
         }
 

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java?view=diff&rev=557200&r1=557199&r2=557200
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java
Wed Jul 18 01:51:48 2007
@@ -2015,4 +2015,40 @@
             return new MethodDescriptor[] { md };
         }
     }
+    public void testProperty() throws IntrospectionException {
+        Class<MockSubClassForPorpertiesStandard> beanClass = MockSubClassForPorpertiesStandard.class;
+        BeanInfo info = Introspector.getBeanInfo(beanClass);
+        assertEquals(-1, info.getDefaultEventIndex());
+        assertEquals(-1, info.getDefaultPropertyIndex());
+        PropertyDescriptor[] pds = info.getPropertyDescriptors();
+        for (PropertyDescriptor pd : pds) {
+            assertFalse(pd.isBound());
+            assertFalse(pd.isConstrained());
+            assertFalse(pd.isExpert());
+            assertFalse(pd.isHidden());
+            assertFalse(pd.isPreferred());
+        }
+        assertEquals(2, info.getPropertyDescriptors().length);
+    }
+
+    static class MockBaseClassForPorpertiesStandard {
+        int a = 0;
+
+        int b = 1;
+    }
+
+    static class MockSubClassForPorpertiesStandard extends
+            MockBaseClassForPorpertiesStandard {
+        int a = 2;
+
+        int b = 3;
+
+        public int getName() {
+            return a;
+        }
+
+        public void setName(int i) {
+            a = i;
+        }
+    }
 }



Mime
View raw message