( Class[] ) types.toArray(), values.toArray() );
( Class[] ) types.toArray( EMPTY_CLASS_ARRAY ), values.toArray() );
    public void handleStoredProcedureExtendedOperation( ServerLdapContext ctx, StoredProcedure pojo )         throws ClassNotFoundException, NamingException    {        List types = new ArrayList( pojo.getParameters().size() );        List values = new ArrayList( pojo.getParameters().size() );                Iterator it = pojo.getParameters().iterator();        while ( it.hasNext() )        {            StoredProcedureParameter pPojo = ( StoredProcedureParameter ) it.next();                        // Get type from String even if it holds a primitive type name            Class type = SpringClassUtils.forName( StringTools.utf8ToString( pPojo.getType() ) );                         types.add( type );                        byte[] value = pPojo.getValue();                        /**             * If the type name refers to a Java primitive then             * we know that the value is encoded as its String representation and             * we retrieve the String and initialize a wrapper of the primitive.             *              * Note that this is just how we prefer Java Specific Stored Procedures             * to handle parameters. Of course we do not have to it this way.             */            if ( type.isPrimitive() )            {                values.add( getInitializedPrimitiveWrapperInstance( type, value ) );            }            /**             * If the type is a complex Java type then             * just deserialize the object.             */            else            {                try                {                    // TODO Irritating syntax! Just wanted to see how it looks like..                    values.add                    (                         (                            new ObjectInputStream                            (                                 new ByteArrayInputStream( value )                            )                         ).readObject()                    );                }                catch (IOException e)                {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                catch (ClassNotFoundException e)                {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }                    }                // TODO determine what to do with the exception        executeProcedure( ctx, StringTools.utf8ToString( pojo.getProcedure() ),                 ( Class[] ) types.toArray(), values.toArray() );    }