protected static MethodType replaceWithMoreSpecificType ( Object [ ] args , MethodType callSiteType ) { for ( int i = 0 ; i < args . length ; i ++ ) { // if argument null, take the static type if ( args [ i ] == null ) continue ; if ( callSiteType . parameterType ( i ) . isPrimitive ( ) ) continue ; Class argClass = args [ i ] . getClass ( ) ; callSiteType = callSiteType . changeParameterType ( i , argClass ) ; } return callSiteType ; }
Replaces the types in the callSiteType parameter if more specific types given through the arguments . This is in general the case unless the argument is null .