harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r478601 - in /harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans: BeanInfoImpl.java BeanInfoWrapper.java Introspector.java
Date Thu, 23 Nov 2006 15:46:12 GMT
Author: ayza
Date: Thu Nov 23 07:46:08 2006
New Revision: 478601

URL: http://svn.apache.org/viewvc?view=rev&rev=478601
Log:
fixes to enable the rest of the failing tests from IntrospectorTest

Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java?view=diff&rev=478601&r1=478600&r2=478601
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
Thu Nov 23 07:46:08 2006
@@ -297,11 +297,11 @@
     }
 
     public int getDefaultPropertyIndex() {
-        return defaultPropertyIndex;
+        return -1;
     }
 
     public int getDefaultEventIndex() {
-        return defaultEventIndex;
+        return -1;
     }
 
     private static int getMethodType(Method method) {
@@ -458,9 +458,5 @@
     private MethodDescriptor[] methodDescriptors = null;
 
     private EventSetDescriptor[] eventSetDescriptors = null;
-
-    private final int defaultPropertyIndex = -1;
-
-    private final int defaultEventIndex = -1;
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java?view=diff&rev=478601&r1=478600&r2=478601
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
Thu Nov 23 07:46:08 2006
@@ -248,10 +248,8 @@
 
         if (info != null) {
             result = info.getDefaultPropertyIndex();
-        }
-
-        if (info == null || result == -1) {
-            result = impl.getDefaultPropertyIndex();
+        } else if (parentBeanInfoWrapper != null) {
+            result = parentBeanInfoWrapper.getDefaultPropertyIndex();
         }
 
         return result;
@@ -262,10 +260,8 @@
 
         if (info != null) {
             result = info.getDefaultEventIndex();
-        }
-
-        if (info == null || result == -1) {
-            result = impl.getDefaultEventIndex();
+        } else if (parentBeanInfoWrapper != null) {
+            result = parentBeanInfoWrapper.getDefaultEventIndex();
         }
 
         return result;

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java?view=diff&rev=478601&r1=478600&r2=478601
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
Thu Nov 23 07:46:08 2006
@@ -68,7 +68,7 @@
             case IGNORE_ALL_BEANINFO:
                 return getBeanInfo(beanClass, null, true, true);
             default:
-                // TODO: verify that default beahvior complies with RI
+                // TODO: verify that default behavior complies with RI
                 return getBeanInfo(beanClass, null, false, false);
         }
     }
@@ -84,17 +84,23 @@
     }
 
     public static synchronized void setBeanInfoSearchPath(String[] searchPath) {
-        if (searchPath != null) {
-            SecurityManager sm = System.getSecurityManager();
-            if (sm != null) {
-                sm.checkPropertiesAccess();
-            }
-            path = searchPath;
+        SecurityManager sm = System.getSecurityManager();
+
+        if (sm != null) {
+            sm.checkPropertiesAccess();
         }
+        
+        path = searchPath;
     }
 
     public static synchronized String[] getBeanInfoSearchPath() {
-        return path;
+        // compatible with RI
+        if (path == null) {
+            throw new NullPointerException(
+                    Messages.getString("beans.4F")); //$NON-NLS-1$
+        }
+
+        return path.clone();
     }
 
     public static void flushFromCaches(Class<?> clz) {



Mime
View raw message