public static boolean compatibleClasses ( Class < ? > [ ] lhs , Class < ? > [ ] rhs ) { if ( lhs . length != rhs . length ) { return false ; } for ( int i = 0 ; i < lhs . length ; ++ i ) { if ( rhs [ i ] == null || rhs [ i ] . equals ( Void . TYPE ) ) { if ( lhs [ i ] . isPrimitive ( ) ) { return false ; } else { continue ; } } if ( ! lhs [ i ] . isAssignableFrom ( rhs [ i ] ) ) { Class < ? > lhsPrimEquiv = primitiveEquivalentOf ( lhs [ i ] ) ; Class < ? > rhsPrimEquiv = primitiveEquivalentOf ( rhs [ i ] ) ; if ( ! primitiveIsAssignableFrom ( lhsPrimEquiv , rhsPrimEquiv ) ) { return false ; } } } return true ; }
Tells whether instances of the classes in the rhs array could be used as parameters to a reflective method invocation whose parameter list has types denoted by the lhs array .