xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java [215:254]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ConstructionInfo constructionInfo = new ConstructionInfo(constructor, metadata);
            if (isUsableConstructor(constructionInfo, definedProperties)) {
                return constructionInfo;
            }
        }
        return null;
    }

    private boolean isUsableConstructor(ConstructionInfo constructionInfo, Set definedProperties) {
        // if we don't have parameter names this is not the constructor we are looking for
        String[] parameterNames = constructionInfo.parameterNames;
        if (parameterNames == null) {
            return false;
        }

        Class[] parameterTypes = constructionInfo.parameterTypes;
        for (int i = 0; i < parameterNames.length; i++) {
            String parameterName = parameterNames[i];
            Class parameterType = parameterTypes[i];

            // can we satify this property using a defined property or default property
            if (!definedProperties.contains(parameterName) && !defaultValues.containsKey(new PropertyKey(parameterName, parameterType))) {
                return false;
            }
        }

        return true;
    }

    private class ConstructionInfo {
        private final Class[] parameterTypes;
        private final String[] parameterNames;

        public ConstructionInfo(Constructor constructor, MappingMetaData metadata) {
            this.parameterTypes = constructor.getParameterTypes();
            String[] names = metadata.getParameterNames(constructor);

            // verify that we have enough parameter names
            int expectedParameterCount = parameterTypes.length;
            if (names != null && names.length != expectedParameterCount) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



xbean-spring/src/main/java/org/apache/xbean/spring/context/impl/NamedConstructorArgs.java [221:260]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            ConstructionInfo constructionInfo = new ConstructionInfo(constructor, metadata);
            if (isUsableConstructor(constructionInfo, definedProperties)) {
                return constructionInfo;
            }
        }
        return null;
    }

    private boolean isUsableConstructor(ConstructionInfo constructionInfo, Set definedProperties) {
        // if we don't have parameter names this is not the constructor we are looking for
        String[] parameterNames = constructionInfo.parameterNames;
        if (parameterNames == null) {
            return false;
        }

        Class[] parameterTypes = constructionInfo.parameterTypes;
        for (int i = 0; i < parameterNames.length; i++) {
            String parameterName = parameterNames[i];
            Class parameterType = parameterTypes[i];

            // can we satify this property using a defined property or default property
            if (!definedProperties.contains(parameterName) && !defaultValues.containsKey(new PropertyKey(parameterName, parameterType))) {
                return false;
            }
        }

        return true;
    }

    private class ConstructionInfo {
        private final Class[] parameterTypes;
        private final String[] parameterNames;

        public ConstructionInfo(Constructor constructor, MappingMetaData metadata) {
            this.parameterTypes = constructor.getParameterTypes();
            String[] names = metadata.getParameterNames(constructor);

            // verify that we have enough parameter names
            int expectedParameterCount = parameterTypes.length;
            if (names != null && names.length != expectedParameterCount) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



