private static boolean isBridgeRequired ( Map < String , Class < ? > > types , Method method ) { // check return type TypeVariable < ? > var = getTypeVariable ( method . getGenericReturnType ( ) ) ; if ( var != null && types . containsKey ( var . getName ( ) ) ) { return true ; } // check param types for ( Type paramType : method . getGenericParameterTypes ( ) ) { var = getTypeVariable ( paramType ) ; if ( var != null && types . containsKey ( var . getName ( ) ) ) { return true ; } } // not required return false ; }
Check whether a bridge is required for the given method and generic type information . If the return type or any parameter contains a type variable that is specified and overridden with a more specific type via the given types then a bridge will be required .