< T extends JCTree > List < T > translateArgs ( List < T > _args , List < Type > parameters , Type varargsElement ) { if ( parameters . isEmpty ( ) ) return _args ; List < T > args = _args ; while ( parameters . tail . nonEmpty ( ) ) { args . head = translate ( args . head , parameters . head ) ; args = args . tail ; parameters = parameters . tail ; } Type parameter = parameters . head ; Assert . check ( varargsElement != null || args . length ( ) == 1 ) ; if ( varargsElement != null ) { while ( args . nonEmpty ( ) ) { args . head = translate ( args . head , varargsElement ) ; args = args . tail ; } } else { args . head = translate ( args . head , parameter ) ; } return _args ; }
Translate method argument list casting each argument to its corresponding type in a list of target types .