public <T> Constructor<T> getConstructor( Class<T> targetClass, Class[] params )
        throws ReflectorException
    {
        Map<String, Constructor<T>> constructorMap = getConstructorMap( targetClass );

        StringBuilder key = new StringBuilder( 200 );

        key.append( "(" );

        for ( int i = 0, len = params.length; i < len; i++ )
        {
            key.append( params[i].getName() );
            key.append( "," );
        }

        if ( params.length > 0 )
        {
            key.setLength( key.length() - 1 );
        }

        key.append( ")" );

        Constructor<T> constructor;

        String paramKey = key.toString();

        synchronized ( paramKey.intern() )
        {
            constructor = constructorMap.get( paramKey );

            if ( constructor == null )
            {
                @SuppressWarnings( { "unchecked" } )
                Constructor<T>[] cands = (Constructor<T>[]) targetClass.getConstructors();

                for ( int i = 0, len = cands.length; i < len; i++ )
                {
                    Class[] types = cands[i].getParameterTypes();

                    if ( params.length != types.length )
                    {
                        continue;
                    }

                    for ( int j = 0, len2 = params.length; j < len2; j++ )
                    {
                        if ( !types[j].isAssignableFrom( params[j] ) )
                        {
                            continue;
                        }
                    }

                    // we got it, so store it!
                    constructor = cands[i];
                    constructorMap.put( paramKey, constructor );
                }
            }
        }

        if ( constructor == null )
        {
            throw new ReflectorException( "Error retrieving constructor object for: " + targetClass.getName()
                + paramKey );
        }

        return constructor;
    }