void restoreArgsFromArray ( String desc ) { Type [ ] methodArgs = Type . getArgumentTypes ( desc ) ; for ( int i = 0 ; i < methodArgs . length ; i ++ ) { // [target] array visitInsn ( DUP ) ; // [target] args... array array visitLdcInsn ( Integer . valueOf ( i ) ) ; // [target] args... array array idx visitInsn ( AALOAD ) ; // [target] args... array boxed unbox ( methodArgs [ i ] ) ; // [target] args... array arg if ( methodArgs [ i ] . getSize ( ) == 2 ) { visitInsn ( DUP2_X1 ) ; // [target] args... array arg_arg visitInsn ( POP2 ) ; // [target] args... array } else { visitInsn ( SWAP ) ; // [target] args... array } } visitInsn ( POP ) ; // [target] args... }
Recreate the parameter list for the target method from an Object array containing the data .