private void addArrayMethods ( List < MethodNode > methods , ClassNode receiver , String name , ClassNode [ ] args ) { if ( args . length != 1 ) return ; if ( ! receiver . isArray ( ) ) return ; if ( ! isIntCategory ( getUnwrapper ( args [ 0 ] ) ) ) return ; if ( "getAt" . equals ( name ) ) { MethodNode node = new MethodNode ( name , Opcodes . ACC_PUBLIC , receiver . getComponentType ( ) , new Parameter [ ] { new Parameter ( args [ 0 ] , "arg" ) } , null , null ) ; node . setDeclaringClass ( receiver . redirect ( ) ) ; methods . add ( node ) ; } else if ( "setAt" . equals ( name ) ) { MethodNode node = new MethodNode ( name , Opcodes . ACC_PUBLIC , VOID_TYPE , new Parameter [ ] { new Parameter ( args [ 0 ] , "arg" ) } , null , null ) ; node . setDeclaringClass ( receiver . redirect ( ) ) ; methods . add ( node ) ; } }
add various getAt and setAt methods for primitive arrays