question: public static ReferenceBinding [ ] substitute ( Substitution substitution , ReferenceBinding [ ] originalTypes ) { if ( originalTypes == null ) return null ; ReferenceBinding [ ] substitutedTypes = originalTypes ; for ( int i = 0 , length = originalTypes . length ; i < length ; i ++ ) { ReferenceBinding originalType = originalTypes [ i ] ; TypeBinding substitutedType = substitute ( substitution , originalType ) ; if ( ! ( substitutedType instanceof ReferenceBinding ) ) { return null ; } if ( substitutedType != originalType ) { if ( substitutedTypes == originalTypes ) { System . arraycopy ( originalTypes , 0 , substitutedTypes = new ReferenceBinding [ length ] , 0 , i ) ; } substitutedTypes [ i ] = ( ReferenceBinding ) substitutedType ; } else if ( substitutedTypes != originalTypes ) { substitutedTypes [ i ] = originalType ; } } return substitutedTypes ; }
target:  Returns an array of types, where original types got substituted given a substitution. Only allocate an array if anything is different.