public MethodHandle nop ( ) { if ( type ( ) . returnType ( ) != void . class ) { throw new InvalidTransformException ( "must have void return type to nop: " + type ( ) ) ; } return invoke ( Binder . from ( type ( ) ) . drop ( 0 , type ( ) . parameterCount ( ) ) . cast ( Object . class ) . constant ( null ) ) ; }
Apply all transforms to an endpoint that does absolutely nothing . Useful for creating exception handlers in void methods that simply ignore the exception .