harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r414913 [1/2] - /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/
Date Fri, 16 Jun 2006 21:11:02 GMT
Author: ndbeyer
Date: Fri Jun 16 14:11:01 2006
New Revision: 414913

URL: http://svn.apache.org/viewvc?rev=414913&view=rev
Log:
Code cleanup; generification, one java class to file, etc

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java   (with props)
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java   (with props)
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyDescriptor.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Statement.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java?rev=414913&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java Fri Jun 16 14:11:01 2006
@@ -0,0 +1,57 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package java.beans;
+
+class BeanInfoData {
+
+    private Class<?> stopClass;
+    private boolean ignoreBeanClassBeanInfo;
+    private boolean ignoreSuperClassBeanInfo;
+    private BeanInfoWrapper beanInfoWrapper;
+
+    public BeanInfoData(BeanInfoWrapper beanInfo) {
+        this.stopClass = null;
+        this.ignoreBeanClassBeanInfo = false;
+        this.ignoreSuperClassBeanInfo = false;
+        this.beanInfoWrapper = beanInfo;
+    }
+
+    public BeanInfoData(Class<?> stopClass, boolean ignoreBeanClassBeanInfo,
+        boolean ignoreSuperClassBeanInfo, BeanInfoWrapper beanInfoWrapper)
+    {
+        this.stopClass = stopClass;
+        this.ignoreBeanClassBeanInfo = ignoreBeanClassBeanInfo;
+        this.ignoreSuperClassBeanInfo = ignoreSuperClassBeanInfo;
+        this.beanInfoWrapper = beanInfoWrapper;
+    }
+
+    public Class<?> getStopClass() {
+        return stopClass;
+    }
+
+    public boolean getIgnoreBeanClassBeanInfo() {
+        return ignoreBeanClassBeanInfo;
+    }
+
+    public boolean getIgnoreSuperClassBeanInfo() {
+        return ignoreSuperClassBeanInfo;
+    }
+
+    public BeanInfoWrapper getBeanInfoWrapper() {
+        return beanInfoWrapper;
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java?rev=414913&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java Fri Jun 16 14:11:01 2006
@@ -0,0 +1,418 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package java.beans;
+
+import java.awt.Image;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+class BeanInfoImpl implements BeanInfo {
+
+    private static int MT_OTHER = 0;
+    private static int MT_SETTER = 1;
+    private static int MT_GETTER = 2;
+    private static int MT_BOOLEAN_GETTER = 3;
+    private static int MT_INDEXED_SETTER = 4;
+    private static int MT_INDEXED_GETTER = 5;
+
+    public BeanInfoImpl(Class<?> beanClass) {
+        this.beanClass = beanClass;
+    }
+
+    public PropertyDescriptor[] getPropertyDescriptors() {
+        if (propertyDescriptors == null) {
+            HashMap<String, PropertyDescriptor> result = new HashMap<String, PropertyDescriptor>();
+            
+            if (beanClass != null) {
+                List<Method> beanClassMethodsArrayList = getPublicMethods(beanClass);
+                
+                ArrayList<Method> setters = new ArrayList<Method>();
+                ArrayList<Method> getters = new ArrayList<Method>();
+                ArrayList<Method> booleanGetters = new ArrayList<Method>();
+                ArrayList<Method> indexedSetters = new ArrayList<Method>();
+                ArrayList<Method> indexedGetters = new ArrayList<Method>();
+                
+                Iterator<Method> iterator = beanClassMethodsArrayList.iterator();
+                while (iterator.hasNext()) {
+                    Method method = (Method) iterator.next();
+                    
+                    int methodType = getMethodType(method);
+                    if (methodType == MT_SETTER) {
+                        setters.add(method);
+                    } else if (methodType == MT_GETTER) {
+                        getters.add(method);
+                    } else if (methodType == MT_BOOLEAN_GETTER) {
+                        booleanGetters.add(method);
+                    } else if (methodType == MT_INDEXED_SETTER) {
+                        indexedSetters.add(method);
+                    } else if (methodType == MT_INDEXED_GETTER) {
+                        indexedGetters.add(method);
+                    }
+                }
+                try {
+                    addIndexedPropertyDescriptorsFromMethodList(result,
+                            indexedGetters, false);
+                    addIndexedPropertyDescriptorsFromMethodList(result,
+                            indexedSetters, true);
+                    addPropertyDescriptorsFromMethodList(result, booleanGetters,
+                            false);
+                    addPropertyDescriptorsFromMethodList(result, setters, true);
+                    addPropertyDescriptorsFromMethodList(result, getters, true);
+                } catch (Exception e) {
+                }
+                
+                Object[] values = result.values().toArray();
+                propertyDescriptors = new PropertyDescriptor[values.length];
+                for(int k = 0; k < propertyDescriptors.length; ++k) {
+                    propertyDescriptors[k] = (PropertyDescriptor) values[k];
+                }
+            }
+        }
+        
+        return propertyDescriptors;
+    }
+
+    public MethodDescriptor[] getMethodDescriptors() {
+        if(methodDescriptors == null) {
+            List<MethodDescriptor> result = new ArrayList<MethodDescriptor>();
+            List<Method> beanClassMethodsArrayList = getPublicMethods(beanClass);
+            
+            Iterator<Method> iterator = beanClassMethodsArrayList.iterator();
+            while (iterator.hasNext()) {
+                Method method = (Method) iterator.next();
+                result.add(new MethodDescriptor(method));
+            }
+            
+            methodDescriptors = new MethodDescriptor[result.size()];
+            for(int i = 0; i < methodDescriptors.length; ++i) {
+                methodDescriptors[i] = (MethodDescriptor) result.get(i);
+            }
+            
+        }
+        
+        return methodDescriptors;
+    }
+
+    public EventSetDescriptor[] getEventSetDescriptors() {
+        if(eventSetDescriptors == null) {
+            Map<String, EventSetDescriptor> result =
+                new HashMap<String, EventSetDescriptor>();
+            List<Method> beanClassMethodsArrayList = getPublicMethods(beanClass);
+            
+            Iterator<Method> iterator = beanClassMethodsArrayList.iterator();
+            while(iterator.hasNext()) {
+                Method method = (Method) iterator.next();
+                String methodName = method.getName();
+                
+                String listenerName = null;
+                if(methodName.endsWith("Listener")) {
+                    listenerName = methodName.substring(0,
+                            methodName.lastIndexOf("Listener"));
+                    
+                    if(methodName.startsWith("add")) {
+                        listenerName = listenerName.substring(3);
+                    } else if(methodName.startsWith("remove")) {
+                        listenerName = listenerName.substring(6);
+                    } else {
+                        continue;
+                    }
+                    
+                    if(result.get(listenerName) == null) {
+                        Class[] parameterTypes = method.getParameterTypes();
+                        
+                        if(parameterTypes.length == 1) {
+                            Class<?> listenerType = parameterTypes[0];
+                            
+                            // full and short names of classes
+                            String listenerTypeName = listenerType.getName();
+
+                            // check if the listener name extracted from param name and
+                            // listener name extracted from registration method are the same
+                            String listenerNameFromParam =
+                                listenerTypeName.substring(
+                                        listenerTypeName.lastIndexOf(".") + 1);
+                            
+                            String listenerNameFromMethod = listenerName
+                                    + "Listener";
+                            if(!listenerNameFromParam.equals(
+                                    listenerNameFromMethod)) {
+                                continue;
+                            }
+                            
+                            String eventTypeName = listenerTypeName.substring(0,
+                                    listenerTypeName.lastIndexOf(".") + 1)
+                                    + listenerName + "Event";
+                            
+                            // classes generated from classes names
+                            Class<?> eventType = null;
+                            try {
+                                eventType = Class.forName(eventTypeName, true,
+                                        beanClass.getClassLoader());
+                            } catch (ClassNotFoundException cnfe) {
+                                System.out.println("Event type with name "
+                                        + eventTypeName + " is not found.");
+                            } finally {
+                                if(eventType == null) {
+                                    continue;
+                                }
+                            }
+                            
+                            Method[] methods = listenerType.getMethods();
+                            Vector<Method> listenerMethodsVec = new Vector<Method>();
+                            for(int i = 0; i < methods.length; ++i) {
+                                Class[] listenerMethodParams =
+                                    methods[i].getParameterTypes();
+                                if(listenerMethodParams.length == 1
+                                        && listenerMethodParams[0] == eventType) {
+                                    listenerMethodsVec.add(methods[i]);
+                                }
+                            }
+                            
+                            Method[] listenerMethods =
+                                    new Method[listenerMethodsVec.size()];
+                            Iterator<Method> iter = listenerMethodsVec.iterator();
+                            int idx2 = 0;
+                            while(iter.hasNext()) {
+                                listenerMethods[idx2] = (Method) iter.next();
+                                idx2++;
+                            }
+                            
+                            Method addListenerMethod = null;
+                            String addListenerMethodName = "add" + listenerName
+                                    + "Listener";
+                            try {
+                                addListenerMethod = beanClass.getMethod(
+                                    addListenerMethodName,
+                                    new Class[] { listenerType });
+                            } catch (NoSuchMethodException nsme) {
+                                // no adder found
+                                continue;
+                            }
+                            
+                            Method removeListenerMethod = null;
+                            String removeListenerMethodName = "remove"
+                                    + listenerName + "Listener";
+                            try {
+                                removeListenerMethod = beanClass.getMethod(
+                                    removeListenerMethodName,
+                                    new Class[] { listenerType });
+                            } catch (NoSuchMethodException nsme) {
+                                // no remover found
+                                continue;
+                            }
+                            
+                            Method getListenerMethod = null;
+                            String getListenerMethodName = "get" + listenerName
+                                    + "Listeners";
+                            try {
+                                getListenerMethod = beanClass.getMethod(
+                                    getListenerMethodName, new Class[] {});
+                            } catch (NoSuchMethodException nsme) {
+                                // no action - getter is not a mandatory method in event set descriptor pattern
+                            }
+
+                            try {
+                                listenerName = Introspector.decapitalize(
+                                        listenerName);
+                                EventSetDescriptor esd = new EventSetDescriptor(
+                                        listenerName,
+                                        listenerType,
+                                        listenerMethods,
+                                        addListenerMethod,
+                                        removeListenerMethod,
+                                        getListenerMethod);
+                                result.put(listenerName, esd);
+                            } catch (IntrospectionException ie) {
+                                System.out.println(
+                                        "Cannot generate event set descriptor "
+                                        + "for name" + listenerName + ".");
+                            }
+                            
+                        }
+                    }
+                }
+            }
+            
+            String[] eventSetDescriptorNames =
+                    new String[result.keySet().size()];
+            Iterator<String> i = result.keySet().iterator();
+            int idx = 0;
+            while(i.hasNext()) {
+                eventSetDescriptorNames[idx++] =
+                    ((EventSetDescriptor) result.get(
+                            (String) i.next())).getName();
+            }
+            
+            Arrays.sort(eventSetDescriptorNames);
+
+            eventSetDescriptors =
+                    new EventSetDescriptor[eventSetDescriptorNames.length];
+            for(int j = 0; j < eventSetDescriptors.length; ++j) {
+                eventSetDescriptors[j] = (EventSetDescriptor) result.get(
+                        eventSetDescriptorNames[j]);
+            }
+            
+        }
+        return eventSetDescriptors;
+    }
+
+    public BeanInfo[] getAdditionalBeanInfo() {
+        // no info is obtained thru automatic introspection
+        return null;
+    }
+
+    public BeanDescriptor getBeanDescriptor() {
+        return new BeanDescriptor(beanClass, null);
+    }
+
+    public Image getIcon(int iconKind) {
+        // no info is obtained thru automatic introspection
+        return null;
+    }
+
+    public int getDefaultPropertyIndex() {
+        return defaultPropertyIndex;
+    }
+
+    public int getDefaultEventIndex() {
+        return defaultEventIndex;
+    }
+
+    private static int getMethodType(Method method) {
+        String name = method.getName();
+        int result = MT_OTHER;
+        try {
+            int modifiers = method.getModifiers();
+            
+            if(Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
+                Class[] parameterTypes = method.getParameterTypes();
+                Class<?> returnType = method.getReturnType();
+
+                if(name.startsWith("get") && (parameterTypes.length == 0)
+                        && (returnType != void.class) && (name.length() > 3)) {
+                    result = MT_GETTER;
+                } else if(name.startsWith("is") && (parameterTypes.length == 0)
+                        && (returnType == boolean.class)
+                        && (name.length() > 2)) {
+                    result = MT_BOOLEAN_GETTER;
+                } else if(name.startsWith("get") && (parameterTypes.length == 1)
+                        && (returnType != void.class)
+                        && (parameterTypes[0] == int.class)
+                        && (name.length() > 3)) {
+                    result = MT_INDEXED_GETTER;
+                } else if(name.startsWith("set") && (parameterTypes.length == 1)
+                        && (returnType == void.class) && (name.length() > 3)) {
+                    result = MT_SETTER;
+                } else if(name.startsWith("set") && (parameterTypes.length == 2)
+                        && (returnType == void.class)
+                        && (parameterTypes[0] == int.class)
+                        && (name.length() > 3)) {
+                    result = MT_INDEXED_SETTER;
+                }
+            }
+        } catch (Exception e) {
+            result = MT_OTHER;
+        }
+        
+        return result;
+    }
+
+    private static String extractPropertyName(String methodName)
+            throws Exception {
+        String result = null;
+        
+        if ( methodName.startsWith("set") || methodName.startsWith("get") ) {
+            result = methodName.substring(3);
+            result = Introspector.decapitalize(result);
+        } else if (methodName.startsWith("is")) {
+            result = methodName.substring(2);
+            result = Introspector.decapitalize(result);
+        }
+        
+        return result;
+    }
+
+    private static List<Method> getPublicMethods(Class<?> theClass) {
+        List<Method> result = new ArrayList<Method>();
+
+        Method[] beanClassMethods = theClass.getDeclaredMethods();
+        for (int i = 0; i < beanClassMethods.length; ++i) {
+            if(Modifier.isPublic(beanClassMethods[i].getModifiers())) {
+                result.add(beanClassMethods[i]);
+            }
+        }
+        
+        return result;
+    }
+    
+    private void addPropertyDescriptorsFromMethodList(
+            HashMap<String, PropertyDescriptor> hmPropertyDescriptors,
+            List<Method> methods,
+            boolean checkExisting) throws Exception
+    {
+        for (Method method : methods) {
+            String methodName = method.getName();
+            String propertyName = extractPropertyName(methodName);
+            if ((!checkExisting) || (hmPropertyDescriptors.get(propertyName) == null)) {
+                PropertyDescriptor propertyDescriptor = null;
+                try {
+                    propertyDescriptor = new PropertyDescriptor(propertyName, beanClass);
+                    hmPropertyDescriptors.put(propertyName, propertyDescriptor);
+                } catch (IntrospectionException ie) {
+                    System.out.println(ie.getClass() + ": " + ie.getMessage());
+                }
+            }
+        }
+    }
+    
+    private void addIndexedPropertyDescriptorsFromMethodList(
+            Map<String, PropertyDescriptor> hmPropertyDescriptors,
+            List<Method> methods,
+            boolean checkExisting) throws Exception
+    {
+        for (Method method : methods) {
+            String methodName = method.getName();
+            String propertyName = extractPropertyName(methodName);
+            if ((!checkExisting) || (hmPropertyDescriptors.get(propertyName) == null)) {
+                IndexedPropertyDescriptor indexedPropertyDescriptor = null;
+                try {
+                    indexedPropertyDescriptor = new IndexedPropertyDescriptor(
+                            propertyName, beanClass);
+                    hmPropertyDescriptors.put(propertyName,
+                            indexedPropertyDescriptor);
+                } catch (IntrospectionException ie) {
+                    System.out.println(ie.getClass() + ": " + ie.getMessage());
+                }
+            }
+        }
+    }
+    
+    private Class<?> beanClass = null;
+    private PropertyDescriptor[] propertyDescriptors = null; 
+    private MethodDescriptor[] methodDescriptors = null;
+    private EventSetDescriptor[] eventSetDescriptors = null;
+    private int defaultPropertyIndex = -1;
+    private int defaultEventIndex = -1;
+    
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java?rev=414913&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java Fri Jun 16 14:11:01 2006
@@ -0,0 +1,366 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package java.beans;
+
+import java.awt.Image;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+class BeanInfoWrapper implements BeanInfo {
+    
+    private BeanInfo info;
+    private BeanInfoImpl impl;
+    private BeanInfoWrapper parentBeanInfoWrapper;
+    
+    public BeanInfoWrapper(BeanInfo info, BeanInfoImpl impl) {
+        this.info = info;
+        this.impl = impl;
+    }
+    
+    public PropertyDescriptor[] getPropertyDescriptors() {
+        PropertyDescriptor[] result = null;
+        PropertyDescriptor[] infoResult = null;
+        
+        if(info != null) {
+            infoResult = info.getPropertyDescriptors();
+            
+            BeanInfo[] infos = info.getAdditionalBeanInfo();
+            if(infos != null) {
+                for(int i = 0; i < infos.length; ++i) {
+                    BeanInfo additionalInfo = infos[i];
+                    
+                    if(infoResult == null) {
+                        infoResult = additionalInfo.getPropertyDescriptors();
+                    } else {
+                        infoResult = concatArraysToOneArray(infoResult,
+                                additionalInfo.getPropertyDescriptors());
+                    }
+                }
+            }
+        }
+        
+        if(info == null || infoResult == null) {
+            PropertyDescriptor[] implResult = impl.getPropertyDescriptors();
+            
+            // merge with parent info
+            if(parentBeanInfoWrapper != null) {
+                PropertyDescriptor[] parentResult =
+                        parentBeanInfoWrapper.getPropertyDescriptors();
+                Map<String, FeatureDescriptor> hm = concatArraysUniqueByName(implResult, parentResult);
+                
+                Collection<FeatureDescriptor> values = hm.values();
+                
+                result = new PropertyDescriptor[values.size()];
+                int idx = 0;
+                Iterator<FeatureDescriptor> iterator = values.iterator();
+                while(iterator.hasNext()) {
+                    result[idx++] = (PropertyDescriptor) iterator.next();
+                }
+                
+                Arrays.sort(result, new Comparator<PropertyDescriptor>() {
+                    public int compare(PropertyDescriptor pd1, PropertyDescriptor pd2) {
+                        return pd1.getName().compareTo(pd2.getName());
+                    }
+                    public boolean equals(Object o) {
+                        return false;
+                    }
+                });
+            } else {
+                result = implResult;
+            }
+        } else {
+            result = infoResult;
+        }
+        
+        return result;
+    }
+
+    public MethodDescriptor[] getMethodDescriptors() {
+        MethodDescriptor[] result = null;
+        MethodDescriptor[] infoResult = null;
+        
+        if(info != null) {
+            infoResult = info.getMethodDescriptors();
+            
+            BeanInfo[] infos = info.getAdditionalBeanInfo();
+            if(infos != null) {
+                for(int i = 0; i < infos.length; ++i) {
+                    BeanInfo additionalInfo = infos[i];
+                    
+                    if(infoResult == null) {
+                        infoResult = additionalInfo.getMethodDescriptors();
+                    } else {
+                        infoResult = concatArraysToOneArray(infoResult,
+                                additionalInfo.getMethodDescriptors());
+                    }
+                }
+            }
+        }
+        
+        if(info == null || infoResult == null) {
+            MethodDescriptor[] implResult = impl.getMethodDescriptors();
+            
+            // merge with parent info
+            if(parentBeanInfoWrapper != null) {
+                MethodDescriptor[] parentResult =
+                        parentBeanInfoWrapper.getMethodDescriptors();
+                result = concatArraysToOneArray(implResult, parentResult);
+            } else {
+                result = implResult;
+            }
+        } else {
+            result = infoResult;
+        }
+
+        if(result != null) {
+            Arrays.sort(result, new Comparator<MethodDescriptor>() {
+                public int compare(MethodDescriptor md1, MethodDescriptor md2) {
+                    return md1.getName().compareTo(md2.getName());
+                }
+                public boolean equals(Object o) {
+                    return false;
+                }
+            });
+        }
+        
+        return result;
+    }
+
+    public EventSetDescriptor[] getEventSetDescriptors() {
+        EventSetDescriptor[] result = null;
+        EventSetDescriptor[] infoResult = null;
+        
+        if(info != null) {
+            infoResult = info.getEventSetDescriptors();
+            
+            BeanInfo[] infos = info.getAdditionalBeanInfo();
+            if(infos != null) {
+                for(int i = 0; i < infos.length; ++i) {
+                    BeanInfo additionalInfo = infos[i];
+                    
+                    if(infoResult == null) {
+                        infoResult = additionalInfo.getEventSetDescriptors();
+                    } else {
+                        infoResult = concatArraysToOneArray(infoResult,
+                                additionalInfo.getEventSetDescriptors());
+                    }
+                }
+            }
+        }
+        
+        if(info == null || infoResult == null) {
+            EventSetDescriptor[] implResult = impl.getEventSetDescriptors();
+            
+            // merge with parent info
+            if(parentBeanInfoWrapper != null) {
+                EventSetDescriptor[] parentResult =
+                        parentBeanInfoWrapper.getEventSetDescriptors();
+                Map<String, FeatureDescriptor> hm = concatArraysUniqueByName(implResult, parentResult);
+                
+                Collection<FeatureDescriptor> values = hm.values();
+                
+                result = new EventSetDescriptor[values.size()];
+                int idx = 0;
+                Iterator<FeatureDescriptor> iterator = values.iterator();
+                while(iterator.hasNext()) {
+                    result[idx++] = (EventSetDescriptor) iterator.next();
+                }
+                
+                Arrays.sort(result, new Comparator<EventSetDescriptor>() {
+                    public int compare(EventSetDescriptor esd1, EventSetDescriptor esd2) {
+                        return esd1.getName().compareTo(esd2.getName());
+                    }
+                    public boolean equals(Object o) {
+                        return false;
+                    }
+                });
+            } else {
+                result = implResult;
+            }
+        } else {
+            result = infoResult;
+        }
+        
+        return result;
+    }
+
+    public BeanInfo[] getAdditionalBeanInfo() {
+        BeanInfo[] result = null;
+        
+        if(info != null) {
+            result = info.getAdditionalBeanInfo();
+        }
+        
+        return result;
+    }
+
+    public BeanDescriptor getBeanDescriptor() {
+        BeanDescriptor result = null;
+        
+        if(info != null) {
+            result = info.getBeanDescriptor();
+        }
+        
+        if(info == null || result == null) {
+            result = impl.getBeanDescriptor();
+        }
+        
+        return result;
+    }
+
+    public Image getIcon(int iconKind) {
+        Image result = null;
+        
+        if(info != null) {
+            result = info.getIcon(iconKind);
+        }
+        
+        return result;
+    }
+
+    public int getDefaultPropertyIndex() {
+        int result = -1;
+        
+        if(info != null) {
+            result = info.getDefaultPropertyIndex();
+        }
+        
+        if(info == null || result == -1) {
+            result = impl.getDefaultPropertyIndex();
+        }
+        
+        return result;
+    }
+
+    public int getDefaultEventIndex() {
+        int result = -1;
+        
+        if(info != null) {
+            result = info.getDefaultEventIndex();
+        }
+        
+        if(info == null || result == -1) {
+            result = impl.getDefaultEventIndex();
+        }
+        
+        return result;
+    }
+    
+    void merge(BeanInfoWrapper parentBeanInfoWrapper) {
+        this.parentBeanInfoWrapper = parentBeanInfoWrapper;
+    }
+    
+    private static Map<String, FeatureDescriptor> concatArraysUniqueByName(FeatureDescriptor[] childs,
+            FeatureDescriptor[] parents) {
+        Map<String, FeatureDescriptor> result = new HashMap<String, FeatureDescriptor>();
+        
+        if(childs != null) {
+            for(int i = 0; i < childs.length; ++i) {
+                result.put(childs[i].getName(), childs[i]);
+            }
+        }
+        
+        if(parents != null) {
+            for(int j = 0; j < parents.length; ++j) {
+                if(result.get(parents[j].getName()) == null) {
+                    result.put(parents[j].getName(), parents[j]);
+                }
+            }
+        }
+        
+        return result;
+    }
+    
+    private static PropertyDescriptor[] concatArraysToOneArray(
+            PropertyDescriptor[] childs, PropertyDescriptor[] parents) {
+        if(childs != null || parents != null) {
+            Map<String, FeatureDescriptor> hm = concatArraysUniqueByName(childs, parents);
+            PropertyDescriptor[] result = new PropertyDescriptor[hm.size()];
+            
+            Iterator<String> iterator = hm.keySet().iterator();
+            int idx = 0;
+            
+            while(iterator.hasNext()) {
+                String name = (String) iterator.next();
+                result[idx++] = (PropertyDescriptor) hm.get(name);
+            }
+            
+            return result;
+        } else {
+            return null;
+        }
+    }
+    
+    private static MethodDescriptor[] concatArraysToOneArray(
+            MethodDescriptor[] childs, MethodDescriptor[] parents) {
+        MethodDescriptor[] result = null;
+        
+        if(childs != null || parents != null) {
+            int resultLength = 0;
+            
+            if(childs != null) {
+                resultLength = childs.length; 
+            }
+            
+            if(parents != null) {
+                resultLength += parents.length;
+            }
+            
+            result = new MethodDescriptor[resultLength];
+
+            if(childs != null) {
+                for(int i = 0; i < childs.length; ++i) {
+                    result[i] = childs[i];
+                }
+            }
+            
+            if(parents != null) {
+                int shift = (childs == null) ? 0 : childs.length; 
+                for(int i = 0; i < parents.length; ++i) {
+                    result[shift + i] = parents[i];
+                }
+            }
+            
+        }
+        
+        return result;
+    }
+    
+    private static EventSetDescriptor[] concatArraysToOneArray(
+            EventSetDescriptor[] childs, EventSetDescriptor[] parents) {
+        if(childs != null || parents != null) {
+            Map<String, FeatureDescriptor> hm = concatArraysUniqueByName(childs, parents);
+            EventSetDescriptor[] result = new EventSetDescriptor[hm.size()];
+            
+            Iterator<String> iterator = hm.keySet().iterator();
+            int idx = 0;
+            
+            while(iterator.hasNext()) {
+                String name = (String) iterator.next();
+                result[idx++] = (EventSetDescriptor) hm.get(name);
+            }
+            
+            return result;
+        } else {
+            return null;
+        }
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java?rev=414913&r1=414912&r2=414913&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java Fri Jun 16 14:11:01 2006
@@ -36,8 +36,8 @@
 public class Encoder {
     
     private ExceptionListener exceptionListener = null;
-    private HashMap<Class, PersistenceDelegate> persistenceDelegates =
-        new HashMap<Class, PersistenceDelegate>();
+    private HashMap<Class<?>, PersistenceDelegate> persistenceDelegates =
+        new HashMap<Class<?>, PersistenceDelegate>();
     
     Vector<Object> roots = new Vector<Object>();
     HashMap<Object, ObjectNode> nodes = new HashMap<Object, ObjectNode>();
@@ -147,7 +147,7 @@
             Object oldInstance = oldExp.getValue();
             
             ObjectNode node = null;
-            Class type = null;
+            Class<?> type = null;
 
             if(oldInstance != null) {
                 type = oldInstance.getClass();
@@ -215,7 +215,7 @@
 
         ObjectNode node = (ObjectNode) nodes.get(oldInstance);
         if(node == null) {
-            Class type = oldInstance.getClass();
+            Class<?> type = oldInstance.getClass();
             
             doWriteObject(oldInstance);
             node = (ObjectNode) nodes.get(oldInstance);
@@ -253,32 +253,32 @@
         return null;
     }
     
-    static boolean isNull(Class type) {
+    static boolean isNull(Class<?> type) {
         return (type == null);
     }
     
-    static boolean isPrimitive(Class type) {
+    static boolean isPrimitive(Class<?> type) {
         return (type == Boolean.class) || (type == Byte.class) ||
             (type == Character.class) || (type == Double.class) ||
             (type == Float.class) || (type == Integer.class) ||
             (type == Long.class) || (type == Short.class);
     }
     
-    static boolean isString(Class type) {
+    static boolean isString(Class<?> type) {
         return (type == String.class);
         
     }
     
-    static boolean isClass(Class type) {
+    static boolean isClass(Class<?> type) {
         return (type == Class.class);
     }
     
     
-    static boolean isArray(Class type) {
+    static boolean isArray(Class<?> type) {
         return type.isArray();
     }
     
-    static String getPrimitiveName(Class type) {
+    static String getPrimitiveName(Class<?> type) {
         String result = null;
         
         if(type == Boolean.class) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java?rev=414913&r1=414912&r2=414913&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java Fri Jun 16 14:11:01 2006
@@ -59,7 +59,7 @@
             arguments = new Object[] { null };
         }
         
-        Class proxyClass = proxy.getClass();
+        Class<?> proxyClass = proxy.getClass();
         // if a proxy
         if(Proxy.isProxyClass(proxyClass)) {
             InvocationHandler handler = Proxy.getInvocationHandler(proxy);
@@ -287,7 +287,7 @@
     }
     
     private PropertyDescriptor findPropertyDescriptor(
-        Class theClass, String propertyName) throws IntrospectionException
+        Class<?> theClass, String propertyName) throws IntrospectionException
     {
         PropertyDescriptor result = null;
         BeanInfo beanInfo = Introspector.getBeanInfo(theClass);
@@ -302,7 +302,7 @@
     }
     
     private Method findStaticGetter(
-        Class theClass, String propertyName) throws IntrospectionException
+        Class<?> theClass, String propertyName) throws IntrospectionException
     {
         Method result = null;
         
@@ -340,7 +340,7 @@
         return result;
     }
     
-    private Method findMethod(Class type, Object[] args) {
+    private Method findMethod(Class<?> type, Object[] args) {
         Method[] methods = type.getMethods();
         
         for(int i = 0; i < methods.length; ++i) {
@@ -353,7 +353,7 @@
         return null;
     }
     
-    private static boolean isPrimitiveWrapper(Class wrapper, Class base) {
+    private static boolean isPrimitiveWrapper(Class<?> wrapper, Class<?> base) {
         return (base == boolean.class) && (wrapper == Boolean.class) ||
             (base == byte.class) && (wrapper == Byte.class) ||
             (base == char.class) && (wrapper == Character.class) ||
@@ -369,7 +369,7 @@
         
         if(parameterTypes.length == arguments.length) {
             for(int i = 0; i < arguments.length; ++i) {
-                Class argumentType = (arguments[i] == null) ? null
+                Class<?> argumentType = (arguments[i] == null) ? null
                         : arguments[i].getClass();
                 if((argumentType == null) || isPrimitiveWrapper(argumentType,
                         parameterTypes[i])) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?rev=414913&r1=414912&r2=414913&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java Fri Jun 16 14:11:01 2006
@@ -34,7 +34,7 @@
 
     private String eventSetName = null;
     
-    private Class listenerType = null;
+    private Class<?> listenerType = null;
     private ArrayList<MethodDescriptor> listenerMethodDescriptors =
         new ArrayList<MethodDescriptor>();
     
@@ -265,10 +265,10 @@
      */
     public Method[] getListenerMethods() {
         Method[] result = new Method[listenerMethodDescriptors.size()];
-        Iterator i = listenerMethodDescriptors.iterator();
+        Iterator<MethodDescriptor> i = listenerMethodDescriptors.iterator();
         int idx = 0;
         while(i.hasNext()) {
-            MethodDescriptor md = (MethodDescriptor) i.next();
+            MethodDescriptor md = i.next();
             result[idx] = md.getMethod();
             idx++;
         }
@@ -281,10 +281,10 @@
     public MethodDescriptor[] getListenerMethodDescriptors() {
         MethodDescriptor[] result =
                 new MethodDescriptor[listenerMethodDescriptors.size()];
-        Iterator i = listenerMethodDescriptors.iterator();
+        Iterator<MethodDescriptor> i = listenerMethodDescriptors.iterator();
         int idx = 0;
         while(i.hasNext()) {
-            result[idx] = (MethodDescriptor) i.next();
+            result[idx] = i.next();
             idx++;
         }
         return result;
@@ -346,7 +346,7 @@
         return inDefaultEventSet;
     }
     
-    private Class getEventType(Class listenerType)
+    private Class<?> getEventType(Class<?> listenerType)
             throws ClassNotFoundException {
         String listenerTypeName = listenerType.getName();
         int idx = listenerTypeName.lastIndexOf("Listener");
@@ -355,7 +355,7 @@
                 listenerType.getClassLoader());
     }
 
-    private boolean checkMethod(Class listenerType, Method listenerMethod)
+    private boolean checkMethod(Class<?> listenerType, Method listenerMethod)
             throws IntrospectionException {
         if(listenerMethod != null
                 && !listenerMethod.getDeclaringClass().isAssignableFrom(
@@ -368,7 +368,7 @@
         }
     }
     
-    private Method findMethodByName(Class listenerType,
+    private Method findMethodByName(Class<?> listenerType,
             String listenerMethodName) throws IntrospectionException {
         try {
             return listenerType.getMethod(listenerMethodName,
@@ -385,10 +385,10 @@
     }
     
     private Method findMethodByPrefix(
-            Class sourceClass,
+            Class<?> sourceClass,
             String prefix,
             String postfix,
-            Class listenerType) {
+            Class<?> listenerType) {
         String fullName = listenerType.getName(); // com.drl.beans.SmthListener
         int idx = fullName.lastIndexOf(".");
         String methodName = prefix + fullName.substring(idx + 1) + postfix; // prefix(e.g., add) + SmthListener
@@ -418,12 +418,12 @@
     }
     
     private static Method checkRegistrationMethod(
-            Class listenerType,
+            Class<?> listenerType,
             Method registrationMethod) throws IntrospectionException {
         if(registrationMethod == null) {
             return null;
         } else {
-            Class returnType = registrationMethod.getReturnType();
+            Class<?> returnType = registrationMethod.getReturnType();
             
             if(returnType != void.class) {
                 throw new IntrospectionException(registrationMethod.getName()
@@ -445,7 +445,7 @@
     }
     
     private static Method checkGetListenerMethod(
-            Class listenerType,
+            Class<?> listenerType,
             Method getListenerMethod) throws IntrospectionException {
         if(getListenerMethod == null) {
             return null;
@@ -457,7 +457,7 @@
                         "No input params are allowed for getListenerMethod");
             }
             
-            Class returnType = getListenerMethod.getReturnType();
+            Class<?> returnType = getListenerMethod.getReturnType();
             if(returnType.isArray()
                     && returnType.getComponentType() == listenerType) {
                 return getListenerMethod;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java?rev=414913&r1=414912&r2=414913&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java Fri Jun 16 14:11:01 2006
@@ -105,8 +105,8 @@
                         + "integer type.");
             }
             
-            Class returnType = indexedGetter.getReturnType();
-            Class indexedPropertyType = getIndexedPropertyType();
+            Class<?> returnType = indexedGetter.getReturnType();
+            Class<?> indexedPropertyType = getIndexedPropertyType();
             if((indexedPropertyType != null) && !returnType.equals(
                     indexedPropertyType)) {
                 throw new IntrospectionException(
@@ -137,14 +137,14 @@
                         + "equal to 2.");
             }
             
-            Class firstParameterType = parameterTypes[0];
+            Class<?> firstParameterType = parameterTypes[0];
             if (!firstParameterType.equals(int.class)) {
                 throw new IntrospectionException(
                         "First parameter type in indexed setter method "
                         + "should be int.");
             }            
             
-            Class secondParameterType = parameterTypes[1];
+            Class<?> secondParameterType = parameterTypes[1];
             if (!secondParameterType.equals(getIndexedPropertyType())) {
                 throw new IntrospectionException(
                         "Second parameter type in indexed setter method "
@@ -188,7 +188,7 @@
      * @com.intel.drl.spec_ref
      */
     public Class<?> getIndexedPropertyType() {
-        Class result = null;
+        Class<?> result = null;
         if (indexedGetter != null) {
             result = indexedGetter.getReturnType();
         } else if (indexedSetter != null) {
@@ -198,7 +198,7 @@
         return result;        
     }
     
-    private void setIndexedReadMethod(Class beanClass,
+    private void setIndexedReadMethod(Class<?> beanClass,
             String indexedGetterName) {
         Method[] getters = findMethods(beanClass, indexedGetterName);
         boolean result = false;
@@ -211,7 +211,7 @@
         }
     }
     
-    private void setIndexedWriteMethod(Class beanClass,
+    private void setIndexedWriteMethod(Class<?> beanClass,
             String indexedSetterName) {
         Method[] setters = findMethods(beanClass, indexedSetterName);
         boolean result = false;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java?rev=414913&r1=414912&r2=414913&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java Fri Jun 16 14:11:01 2006
@@ -14,28 +14,18 @@
  *  limitations under the License.
  */
 
-/**
- * @author Maxim V. Berkultsev
- * @version $Revision$
- */
 package java.beans;
 
-import java.awt.Image;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
 import java.util.HashMap;
 import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Vector;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author Maxim V. Berkultsev
  * @version $Revision$
  */
-
 public class Introspector {
 
     public static final int USE_ALL_BEANINFO = 1;
@@ -137,7 +127,7 @@
 
     // private methods
 
-    private static BeanInfoWrapper getBeanInfo(Class beanClass, Class stopClass,
+    private static BeanInfoWrapper getBeanInfo(Class<?> beanClass, Class<?> stopClass,
         boolean ignoreBeanClassBeanInfo, boolean ignoreSuperClassBeanInfo)
     {
         if (beanClass == null) {
@@ -156,7 +146,7 @@
         BeanInfo beanInfo = null;
         if (!ignoreBeanClassBeanInfo) {
             try {
-                Class beanInfoClass = findBeanInfoClass(beanClass);
+                Class<?> beanInfoClass = findBeanInfoClass(beanClass);
                 if(beanInfoClass != null) {
                     beanInfo = (BeanInfo) beanInfoClass.newInstance();
                 }
@@ -174,7 +164,7 @@
         
         BeanInfoWrapper wrapper = new BeanInfoWrapper(beanInfo, beanInfoImpl);
     
-        Class parent = beanClass.getSuperclass();
+        Class<?> parent = beanClass.getSuperclass();
         if ((parent != null) && (parent != stopClass)) {
             BeanInfoWrapper parentBeanInfo = getBeanInfo(parent, stopClass,
                 ignoreSuperClassBeanInfo, ignoreSuperClassBeanInfo);
@@ -190,14 +180,14 @@
         return wrapper;
     }
 
-    private static Class findBeanInfoClass(Class beanClass) {
+    private static Class<?> findBeanInfoClass(Class<?> beanClass) {
         String beanClassName = beanClass.getName();
         int idx = beanClassName.lastIndexOf(".");
         String shortBeanInfoClassName = beanClassName.substring(idx + 1,
             beanClassName.length()) + "BeanInfo";
         String fullBeanInfoClassName = beanClassName + "BeanInfo";
 
-        Class beanInfoClass = null;
+        Class<?> beanInfoClass = null;
         try {
             beanInfoClass = Class.forName(
                 fullBeanInfoClassName, true, beanClass.getClassLoader());
@@ -219,15 +209,14 @@
     }
 
     private static BeanInfoWrapper findBeanInfoClassInCache(
-            Class beanClass,
-            Class stopClass,
+            Class<?> beanClass,
+            Class<?> stopClass,
             boolean ignoreBeanClassBeanInfo,
             boolean ignoreSuperClassBeanInfo) {
         BeanInfoWrapper result = null;
-        ArrayList beanInfoDatas = (ArrayList) beanInfos.get(
-                beanClass.getName());
+        List<BeanInfoData> beanInfoDatas = beanInfos.get(beanClass.getName());
         if (beanInfoDatas != null) {
-            Iterator iterator = beanInfoDatas.iterator();
+            Iterator<BeanInfoData> iterator = beanInfoDatas.iterator();
             while(iterator.hasNext()) {
                 BeanInfoData beanInfoData = (BeanInfoData) iterator.next();
                 if ((beanInfoData.getStopClass() == stopClass) &&
@@ -246,12 +235,11 @@
     
     private static void storeBeanInfoClassInCache(
             BeanInfoWrapper beanInfoWrapper,
-            Class beanClass,
-            Class stopClass,
+            Class<?> beanClass,
+            Class<?> stopClass,
             boolean ignoreBeanClassBeanInfo,
             boolean ignoreSuperClassBeanInfo) {
-        ArrayList<BeanInfoData> beanInfoDatas = beanInfos.get(
-                beanClass.getName());
+        List<BeanInfoData> beanInfoDatas = beanInfos.get(beanClass.getName());
         if(beanInfoDatas == null) {
             beanInfoDatas = new ArrayList<BeanInfoData>();
             beanInfos.put(beanClass.getName(), beanInfoDatas);
@@ -260,7 +248,7 @@
             ignoreSuperClassBeanInfo, beanInfoWrapper));
     }
 
-    private static void removeBeanInfoClassFromCache(Class beanClass) {
+    private static void removeBeanInfoClassFromCache(Class<?> beanClass) {
         beanInfos.remove(beanClass.getName());
     }
 
@@ -271,789 +259,7 @@
     // private fields
 
     private static String[] path = {"sun.beans.infos"};
-    private static HashMap<String, ArrayList<BeanInfoData>> beanInfos =
-        new HashMap<String, ArrayList<BeanInfoData>>();
-
-}
-
-class BeanInfoData {
-
-    private Class stopClass;
-    private boolean ignoreBeanClassBeanInfo;
-    private boolean ignoreSuperClassBeanInfo;
-    private BeanInfoWrapper beanInfoWrapper;
-
-    public BeanInfoData(BeanInfoWrapper beanInfo) {
-        this.stopClass = null;
-        this.ignoreBeanClassBeanInfo = false;
-        this.ignoreSuperClassBeanInfo = false;
-        this.beanInfoWrapper = beanInfo;
-    }
-
-    public BeanInfoData(Class stopClass, boolean ignoreBeanClassBeanInfo,
-        boolean ignoreSuperClassBeanInfo, BeanInfoWrapper beanInfoWrapper)
-    {
-        this.stopClass = stopClass;
-        this.ignoreBeanClassBeanInfo = ignoreBeanClassBeanInfo;
-        this.ignoreSuperClassBeanInfo = ignoreSuperClassBeanInfo;
-        this.beanInfoWrapper = beanInfoWrapper;
-    }
-
-    public Class getStopClass() {
-        return stopClass;
-    }
-
-    public boolean getIgnoreBeanClassBeanInfo() {
-        return ignoreBeanClassBeanInfo;
-    }
-
-    public boolean getIgnoreSuperClassBeanInfo() {
-        return ignoreSuperClassBeanInfo;
-    }
-
-    public BeanInfoWrapper getBeanInfoWrapper() {
-        return beanInfoWrapper;
-    }
-}
-
-class BeanInfoImpl implements BeanInfo {
-
-    private static int MT_OTHER = 0;
-    private static int MT_SETTER = 1;
-    private static int MT_GETTER = 2;
-    private static int MT_BOOLEAN_GETTER = 3;
-    private static int MT_INDEXED_SETTER = 4;
-    private static int MT_INDEXED_GETTER = 5;
-
-    public BeanInfoImpl(Class beanClass) {
-        this.beanClass = beanClass;
-    }
-
-    public PropertyDescriptor[] getPropertyDescriptors() {
-        if (propertyDescriptors == null) {
-            HashMap result = new HashMap();
-            
-            if (beanClass != null) {
-                ArrayList beanClassMethodsArrayList = getPublicMethods(
-                        beanClass);
-                
-                ArrayList<Method> setters = new ArrayList<Method>();
-                ArrayList<Method> getters = new ArrayList<Method>();
-                ArrayList<Method> booleanGetters = new ArrayList<Method>();
-                ArrayList<Method> indexedSetters = new ArrayList<Method>();
-                ArrayList<Method> indexedGetters = new ArrayList<Method>();
-                
-                Iterator iterator = beanClassMethodsArrayList.iterator();
-                while (iterator.hasNext()) {
-                    Method method = (Method) iterator.next();
-                    
-                    int methodType = getMethodType(method);
-                    if (methodType == MT_SETTER) {
-                        setters.add(method);
-                    } else if (methodType == MT_GETTER) {
-                        getters.add(method);
-                    } else if (methodType == MT_BOOLEAN_GETTER) {
-                        booleanGetters.add(method);
-                    } else if (methodType == MT_INDEXED_SETTER) {
-                        indexedSetters.add(method);
-                    } else if (methodType == MT_INDEXED_GETTER) {
-                        indexedGetters.add(method);
-                    }
-                }
-                try {
-                    addIndexedPropertyDescriptorsFromMethodList(result,
-                            indexedGetters, false);
-                    addIndexedPropertyDescriptorsFromMethodList(result,
-                            indexedSetters, true);
-                    addPropertyDescriptorsFromMethodList(result, booleanGetters,
-                            false);
-                    addPropertyDescriptorsFromMethodList(result, setters, true);
-                    addPropertyDescriptorsFromMethodList(result, getters, true);
-                } catch (Exception e) {
-                }
-                
-                Object[] values = result.values().toArray();
-                propertyDescriptors = new PropertyDescriptor[values.length];
-                for(int k = 0; k < propertyDescriptors.length; ++k) {
-                    propertyDescriptors[k] = (PropertyDescriptor) values[k];
-                }
-            }
-        }
-        
-        return propertyDescriptors;
-    }
-
-    public MethodDescriptor[] getMethodDescriptors() {
-        if(methodDescriptors == null) {
-            ArrayList<MethodDescriptor> result = new ArrayList<MethodDescriptor>();
-            ArrayList beanClassMethodsArrayList = getPublicMethods(beanClass);
-            
-            Iterator iterator = beanClassMethodsArrayList.iterator();
-            while (iterator.hasNext()) {
-                Method method = (Method) iterator.next();
-                result.add(new MethodDescriptor(method));
-            }
-            
-            methodDescriptors = new MethodDescriptor[result.size()];
-            for(int i = 0; i < methodDescriptors.length; ++i) {
-                methodDescriptors[i] = (MethodDescriptor) result.get(i);
-            }
-            
-        }
-        
-        return methodDescriptors;
-    }
-
-    public EventSetDescriptor[] getEventSetDescriptors() {
-        if(eventSetDescriptors == null) {
-            HashMap<String, EventSetDescriptor> result =
-                new HashMap<String, EventSetDescriptor>();
-            ArrayList beanClassMethodsArrayList = getPublicMethods(beanClass);
-            
-            Iterator iterator = beanClassMethodsArrayList.iterator();
-            while(iterator.hasNext()) {
-                Method method = (Method) iterator.next();
-                String methodName = method.getName();
-                
-                String listenerName = null;
-                if(methodName.endsWith("Listener")) {
-                    listenerName = methodName.substring(0,
-                            methodName.lastIndexOf("Listener"));
-                    
-                    if(methodName.startsWith("add")) {
-                        listenerName = listenerName.substring(3);
-                    } else if(methodName.startsWith("remove")) {
-                        listenerName = listenerName.substring(6);
-                    } else {
-                        continue;
-                    }
-                    
-                    if(result.get(listenerName) == null) {
-                        Class[] parameterTypes = method.getParameterTypes();
-                        
-                        if(parameterTypes.length == 1) {
-                            Class listenerType = parameterTypes[0];
-                            
-                            // full and short names of classes
-                            String listenerTypeName = listenerType.getName();
-
-                            // check if the listener name extracted from param name and
-                            // listener name extracted from registration method are the same
-                            String listenerNameFromParam =
-                                listenerTypeName.substring(
-                                        listenerTypeName.lastIndexOf(".") + 1);
-                            
-                            String listenerNameFromMethod = listenerName
-                                    + "Listener";
-                            if(!listenerNameFromParam.equals(
-                                    listenerNameFromMethod)) {
-                                continue;
-                            }
-                            
-                            String eventTypeName = listenerTypeName.substring(0,
-                                    listenerTypeName.lastIndexOf(".") + 1)
-                                    + listenerName + "Event";
-                            
-                            // classes generated from classes names
-                            Class eventType = null;
-                            try {
-                                eventType = Class.forName(eventTypeName, true,
-                                        beanClass.getClassLoader());
-                            } catch (ClassNotFoundException cnfe) {
-                                System.out.println("Event type with name "
-                                        + eventTypeName + " is not found.");
-                            } finally {
-                                if(eventType == null) {
-                                    continue;
-                                }
-                            }
-                            
-                            Method[] methods = listenerType.getMethods();
-                            Vector<Method> listenerMethodsVec = new Vector<Method>();
-                            for(int i = 0; i < methods.length; ++i) {
-                                Class[] listenerMethodParams =
-                                    methods[i].getParameterTypes();
-                                if(listenerMethodParams.length == 1
-                                        && listenerMethodParams[0] == eventType) {
-                                    listenerMethodsVec.add(methods[i]);
-                                }
-                            }
-                            
-                            Method[] listenerMethods =
-                                    new Method[listenerMethodsVec.size()];
-                            Iterator iter = listenerMethodsVec.iterator();
-                            int idx2 = 0;
-                            while(iter.hasNext()) {
-                                listenerMethods[idx2] = (Method) iter.next();
-                                idx2++;
-                            }
-                            
-                            Method addListenerMethod = null;
-                            String addListenerMethodName = "add" + listenerName
-                                    + "Listener";
-                            try {
-                                addListenerMethod = beanClass.getMethod(
-                                    addListenerMethodName,
-                                    new Class[] { listenerType });
-                            } catch (NoSuchMethodException nsme) {
-                                // no adder found
-                                continue;
-                            }
-                            
-                            Method removeListenerMethod = null;
-                            String removeListenerMethodName = "remove"
-                                    + listenerName + "Listener";
-                            try {
-                                removeListenerMethod = beanClass.getMethod(
-                                    removeListenerMethodName,
-                                    new Class[] { listenerType });
-                            } catch (NoSuchMethodException nsme) {
-                                // no remover found
-                                continue;
-                            }
-                            
-                            Method getListenerMethod = null;
-                            String getListenerMethodName = "get" + listenerName
-                                    + "Listeners";
-                            try {
-                                getListenerMethod = beanClass.getMethod(
-                                    getListenerMethodName, new Class[] {});
-                            } catch (NoSuchMethodException nsme) {
-                                // no action - getter is not a mandatory method in event set descriptor pattern
-                            }
-
-                            try {
-                                listenerName = Introspector.decapitalize(
-                                        listenerName);
-                                EventSetDescriptor esd = new EventSetDescriptor(
-                                        listenerName,
-                                        listenerType,
-                                        listenerMethods,
-                                        addListenerMethod,
-                                        removeListenerMethod,
-                                        getListenerMethod);
-                                result.put(listenerName, esd);
-                            } catch (IntrospectionException ie) {
-                                System.out.println(
-                                        "Cannot generate event set descriptor "
-                                        + "for name" + listenerName + ".");
-                            }
-                            
-                        }
-                    }
-                }
-            }
-            
-            String[] eventSetDescriptorNames =
-                    new String[result.keySet().size()];
-            Iterator i = result.keySet().iterator();
-            int idx = 0;
-            while(i.hasNext()) {
-                eventSetDescriptorNames[idx++] =
-                    ((EventSetDescriptor) result.get(
-                            (String) i.next())).getName();
-            }
-            
-            Arrays.sort(eventSetDescriptorNames);
-
-            eventSetDescriptors =
-                    new EventSetDescriptor[eventSetDescriptorNames.length];
-            for(int j = 0; j < eventSetDescriptors.length; ++j) {
-                eventSetDescriptors[j] = (EventSetDescriptor) result.get(
-                        eventSetDescriptorNames[j]);
-            }
-            
-        }
-        return eventSetDescriptors;
-    }
-
-    public BeanInfo[] getAdditionalBeanInfo() {
-        // no info is obtained thru automatic introspection
-        return null;
-    }
-
-    public BeanDescriptor getBeanDescriptor() {
-        return new BeanDescriptor(beanClass, null);
-    }
+    private static Map<String, List<BeanInfoData>> beanInfos =
+        new HashMap<String, List<BeanInfoData>>();
 
-    public Image getIcon(int iconKind) {
-        // no info is obtained thru automatic introspection
-        return null;
-    }
-
-    public int getDefaultPropertyIndex() {
-        return defaultPropertyIndex;
-    }
-
-    public int getDefaultEventIndex() {
-        return defaultEventIndex;
-    }
-
-    private static int getMethodType(Method method) {
-        String name = method.getName();
-        int result = MT_OTHER;
-        try {
-            int modifiers = method.getModifiers();
-            
-            if(Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) {
-                Class[] parameterTypes = method.getParameterTypes();
-                Class returnType = method.getReturnType();
-
-                if(name.startsWith("get") && (parameterTypes.length == 0)
-                        && (returnType != void.class) && (name.length() > 3)) {
-                    result = MT_GETTER;
-                } else if(name.startsWith("is") && (parameterTypes.length == 0)
-                        && (returnType == boolean.class)
-                        && (name.length() > 2)) {
-                    result = MT_BOOLEAN_GETTER;
-                } else if(name.startsWith("get") && (parameterTypes.length == 1)
-                        && (returnType != void.class)
-                        && (parameterTypes[0] == int.class)
-                        && (name.length() > 3)) {
-                    result = MT_INDEXED_GETTER;
-                } else if(name.startsWith("set") && (parameterTypes.length == 1)
-                        && (returnType == void.class) && (name.length() > 3)) {
-                    result = MT_SETTER;
-                } else if(name.startsWith("set") && (parameterTypes.length == 2)
-                        && (returnType == void.class)
-                        && (parameterTypes[0] == int.class)
-                        && (name.length() > 3)) {
-                    result = MT_INDEXED_SETTER;
-                }
-            }
-        } catch (Exception e) {
-            result = MT_OTHER;
-        }
-        
-        return result;
-    }
-
-    private static String extractPropertyName(String methodName)
-            throws Exception {
-        String result = null;
-        
-        if ( methodName.startsWith("set") || methodName.startsWith("get") ) {
-            result = methodName.substring(3);
-            result = Introspector.decapitalize(result);
-        } else if (methodName.startsWith("is")) {
-            result = methodName.substring(2);
-            result = Introspector.decapitalize(result);
-        }
-        
-        return result;
-    }
-
-    private static ArrayList getPublicMethods(Class theClass) {
-        ArrayList<Method> result = new ArrayList<Method>();
-
-        Method[] beanClassMethods = theClass.getDeclaredMethods();
-        for (int i = 0; i < beanClassMethods.length; ++i) {
-            if(Modifier.isPublic(beanClassMethods[i].getModifiers())) {
-                result.add(beanClassMethods[i]);
-            }
-        }
-        
-        return result;
-    }
-    
-    private void addPropertyDescriptorsFromMethodList(
-            HashMap<String, PropertyDescriptor> hmPropertyDescriptors,
-            ArrayList methods,
-            boolean checkExisting) throws Exception
-    {
-        Iterator iterator = methods.iterator();
-        while(iterator.hasNext()) {
-            Method method = (Method) iterator.next();
-            String methodName = method.getName();
-            String propertyName = extractPropertyName(methodName);
-            if ((!checkExisting) || (hmPropertyDescriptors.get(propertyName) == null)) {
-                PropertyDescriptor propertyDescriptor = null;
-                try {
-                    propertyDescriptor = new PropertyDescriptor(propertyName, beanClass);
-                    hmPropertyDescriptors.put(propertyName, propertyDescriptor);
-                } catch (IntrospectionException ie) {
-                    System.out.println(ie.getClass() + ": " + ie.getMessage());
-                }
-            }
-        }
-    }
-    
-    private void addIndexedPropertyDescriptorsFromMethodList(
-            HashMap<String, IndexedPropertyDescriptor> hmPropertyDescriptors,
-            ArrayList methods,
-            boolean checkExisting) throws Exception
-    {
-        Iterator iterator = methods.iterator();
-        while(iterator.hasNext()) {
-            Method method = (Method) iterator.next();
-            String methodName = method.getName();
-            String propertyName = extractPropertyName(methodName);
-            if ((!checkExisting) || (hmPropertyDescriptors.get(propertyName) == null)) {
-                IndexedPropertyDescriptor indexedPropertyDescriptor = null;
-                try {
-                    indexedPropertyDescriptor = new IndexedPropertyDescriptor(
-                            propertyName, beanClass);
-                    hmPropertyDescriptors.put(propertyName,
-                            indexedPropertyDescriptor);
-                } catch (IntrospectionException ie) {
-                    System.out.println(ie.getClass() + ": " + ie.getMessage());
-                }
-            }
-        }
-    }
-    
-    private Class beanClass = null;
-    private PropertyDescriptor[] propertyDescriptors = null; 
-    private MethodDescriptor[] methodDescriptors = null;
-    private EventSetDescriptor[] eventSetDescriptors = null;
-    private int defaultPropertyIndex = -1;
-    private int defaultEventIndex = -1;
-    
-}
-
-class BeanInfoWrapper implements BeanInfo {
-    
-    private BeanInfo info;
-    private BeanInfoImpl impl;
-    private BeanInfoWrapper parentBeanInfoWrapper;
-    
-    public BeanInfoWrapper(BeanInfo info, BeanInfoImpl impl) {
-        this.info = info;
-        this.impl = impl;
-    }
-    
-    public PropertyDescriptor[] getPropertyDescriptors() {
-        PropertyDescriptor[] result = null;
-        PropertyDescriptor[] infoResult = null;
-        
-        if(info != null) {
-            infoResult = info.getPropertyDescriptors();
-            
-            BeanInfo[] infos = info.getAdditionalBeanInfo();
-            if(infos != null) {
-                for(int i = 0; i < infos.length; ++i) {
-                    BeanInfo additionalInfo = infos[i];
-                    
-                    if(infoResult == null) {
-                        infoResult = additionalInfo.getPropertyDescriptors();
-                    } else {
-                        infoResult = concatArraysToOneArray(infoResult,
-                                additionalInfo.getPropertyDescriptors());
-                    }
-                }
-            }
-        }
-        
-        if(info == null || infoResult == null) {
-            PropertyDescriptor[] implResult = impl.getPropertyDescriptors();
-            
-            // merge with parent info
-            if(parentBeanInfoWrapper != null) {
-                PropertyDescriptor[] parentResult =
-                        parentBeanInfoWrapper.getPropertyDescriptors();
-                HashMap hm = concatArraysUniqueByName(implResult, parentResult);
-                
-                Collection values = hm.values();
-                
-                result = new PropertyDescriptor[values.size()];
-                int idx = 0;
-                Iterator iterator = values.iterator();
-                while(iterator.hasNext()) {
-                    result[idx++] = (PropertyDescriptor) iterator.next();
-                }
-                
-                Arrays.sort(result, new Comparator() {
-                    public int compare(Object o1, Object o2) {
-                        PropertyDescriptor pd1 = (PropertyDescriptor) o1;
-                        PropertyDescriptor pd2 = (PropertyDescriptor) o2;
-                        return pd1.getName().compareTo(pd2.getName());
-                    }
-                    public boolean equals(Object o) {
-                        return false;
-                    }
-                });
-            } else {
-                result = implResult;
-            }
-        } else {
-            result = infoResult;
-        }
-        
-        return result;
-    }
-
-    public MethodDescriptor[] getMethodDescriptors() {
-        MethodDescriptor[] result = null;
-        MethodDescriptor[] infoResult = null;
-        
-        if(info != null) {
-            infoResult = info.getMethodDescriptors();
-            
-            BeanInfo[] infos = info.getAdditionalBeanInfo();
-            if(infos != null) {
-                for(int i = 0; i < infos.length; ++i) {
-                    BeanInfo additionalInfo = infos[i];
-                    
-                    if(infoResult == null) {
-                        infoResult = additionalInfo.getMethodDescriptors();
-                    } else {
-                        infoResult = concatArraysToOneArray(infoResult,
-                                additionalInfo.getMethodDescriptors());
-                    }
-                }
-            }
-        }
-        
-        if(info == null || infoResult == null) {
-            MethodDescriptor[] implResult = impl.getMethodDescriptors();
-            
-            // merge with parent info
-            if(parentBeanInfoWrapper != null) {
-                MethodDescriptor[] parentResult =
-                        parentBeanInfoWrapper.getMethodDescriptors();
-                result = concatArraysToOneArray(implResult, parentResult);
-            } else {
-                result = implResult;
-            }
-        } else {
-            result = infoResult;
-        }
-
-        if(result != null) {
-            Arrays.sort(result, new Comparator() {
-                public int compare(Object o1, Object o2) {
-                    MethodDescriptor md1 = (MethodDescriptor) o1;
-                    MethodDescriptor md2 = (MethodDescriptor) o2;
-                    return md1.getName().compareTo(md2.getName());
-                }
-                public boolean equals(Object o) {
-                    return false;
-                }
-            });
-        }
-        
-        return result;
-    }
-
-    public EventSetDescriptor[] getEventSetDescriptors() {
-        EventSetDescriptor[] result = null;
-        EventSetDescriptor[] infoResult = null;
-        
-        if(info != null) {
-            infoResult = info.getEventSetDescriptors();
-            
-            BeanInfo[] infos = info.getAdditionalBeanInfo();
-            if(infos != null) {
-                for(int i = 0; i < infos.length; ++i) {
-                    BeanInfo additionalInfo = infos[i];
-                    
-                    if(infoResult == null) {
-                        infoResult = additionalInfo.getEventSetDescriptors();
-                    } else {
-                        infoResult = concatArraysToOneArray(infoResult,
-                                additionalInfo.getEventSetDescriptors());
-                    }
-                }
-            }
-        }
-        
-        if(info == null || infoResult == null) {
-            EventSetDescriptor[] implResult = impl.getEventSetDescriptors();
-            
-            // merge with parent info
-            if(parentBeanInfoWrapper != null) {
-                EventSetDescriptor[] parentResult =
-                        parentBeanInfoWrapper.getEventSetDescriptors();
-                HashMap hm = concatArraysUniqueByName(implResult, parentResult);
-                
-                Collection values = hm.values();
-                
-                result = new EventSetDescriptor[values.size()];
-                int idx = 0;
-                Iterator iterator = values.iterator();
-                while(iterator.hasNext()) {
-                    result[idx++] = (EventSetDescriptor) iterator.next();
-                }
-                
-                Arrays.sort(result, new Comparator() {
-                    public int compare(Object o1, Object o2) {
-                        EventSetDescriptor esd1 = (EventSetDescriptor) o1;
-                        EventSetDescriptor esd2 = (EventSetDescriptor) o2;
-                        return esd1.getName().compareTo(esd2.getName());
-                    }
-                    public boolean equals(Object o) {
-                        return false;
-                    }
-                });
-            } else {
-                result = implResult;
-            }
-        } else {
-            result = infoResult;
-        }
-        
-        return result;
-    }
-
-    public BeanInfo[] getAdditionalBeanInfo() {
-        BeanInfo[] result = null;
-        
-        if(info != null) {
-            result = info.getAdditionalBeanInfo();
-        }
-        
-        return result;
-    }
-
-    public BeanDescriptor getBeanDescriptor() {
-        BeanDescriptor result = null;
-        
-        if(info != null) {
-            result = info.getBeanDescriptor();
-        }
-        
-        if(info == null || result == null) {
-            result = impl.getBeanDescriptor();
-        }
-        
-        return result;
-    }
-
-    public Image getIcon(int iconKind) {
-        Image result = null;
-        
-        if(info != null) {
-            result = info.getIcon(iconKind);
-        }
-        
-        return result;
-    }
-
-    public int getDefaultPropertyIndex() {
-        int result = -1;
-        
-        if(info != null) {
-            result = info.getDefaultPropertyIndex();
-        }
-        
-        if(info == null || result == -1) {
-            result = impl.getDefaultPropertyIndex();
-        }
-        
-        return result;
-    }
-
-    public int getDefaultEventIndex() {
-        int result = -1;
-        
-        if(info != null) {
-            result = info.getDefaultEventIndex();
-        }
-        
-        if(info == null || result == -1) {
-            result = impl.getDefaultEventIndex();
-        }
-        
-        return result;
-    }
-    
-    void merge(BeanInfoWrapper parentBeanInfoWrapper) {
-        this.parentBeanInfoWrapper = parentBeanInfoWrapper;
-    }
-    
-    private static HashMap concatArraysUniqueByName(FeatureDescriptor[] childs,
-            FeatureDescriptor[] parents) {
-        HashMap result = new HashMap();
-        
-        if(childs != null) {
-            for(int i = 0; i < childs.length; ++i) {
-                result.put(childs[i].getName(), childs[i]);
-            }
-        }
-        
-        if(parents != null) {
-            for(int j = 0; j < parents.length; ++j) {
-                if(result.get(parents[j].getName()) == null) {
-                    result.put(parents[j].getName(), parents[j]);
-                }
-            }
-        }
-        
-        return result;
-    }
-    
-    private static PropertyDescriptor[] concatArraysToOneArray(
-            PropertyDescriptor[] childs, PropertyDescriptor[] parents) {
-        if(childs != null || parents != null) {
-            HashMap hm = concatArraysUniqueByName(childs, parents);
-            PropertyDescriptor[] result = new PropertyDescriptor[hm.size()];
-            
-            Iterator iterator = hm.keySet().iterator();
-            int idx = 0;
-            
-            while(iterator.hasNext()) {
-                String name = (String) iterator.next();
-                result[idx++] = (PropertyDescriptor) hm.get(name);
-            }
-            
-            return result;
-        } else {
-            return null;
-        }
-    }
-    
-    private static MethodDescriptor[] concatArraysToOneArray(
-            MethodDescriptor[] childs, MethodDescriptor[] parents) {
-        MethodDescriptor[] result = null;
-        
-        if(childs != null || parents != null) {
-            int resultLength = 0;
-            
-            if(childs != null) {
-                resultLength = childs.length; 
-            }
-            
-            if(parents != null) {
-                resultLength += parents.length;
-            }
-            
-            result = new MethodDescriptor[resultLength];
-
-            if(childs != null) {
-                for(int i = 0; i < childs.length; ++i) {
-                    result[i] = childs[i];
-                }
-            }
-            
-            if(parents != null) {
-                int shift = (childs == null) ? 0 : childs.length; 
-                for(int i = 0; i < parents.length; ++i) {
-                    result[shift + i] = parents[i];
-                }
-            }
-            
-        }
-        
-        return result;
-    }
-    
-    private static EventSetDescriptor[] concatArraysToOneArray(
-            EventSetDescriptor[] childs, EventSetDescriptor[] parents) {
-        if(childs != null || parents != null) {
-            HashMap hm = concatArraysUniqueByName(childs, parents);
-            EventSetDescriptor[] result = new EventSetDescriptor[hm.size()];
-            
-            Iterator iterator = hm.keySet().iterator();
-            int idx = 0;
-            
-            while(iterator.hasNext()) {
-                String name = (String) iterator.next();
-                result[idx++] = (EventSetDescriptor) hm.get(name);
-            }
-            
-            return result;
-        } else {
-            return null;
-        }
-    }
 }



Mime
View raw message