question: @ SuppressWarnings ( "unchecked" ) @ Override public Object apply ( String source , int lineNo , int columnNo , Object funcBody , Vector namesVec , Vector argsVec ) throws BSFException { if ( namesVec . size ( ) != argsVec . size ( ) ) throw new BSFException ( "number of params/names mismatch" ) ; if ( ! ( funcBody instanceof String ) ) throw new BSFException ( "apply: function body must be a string" ) ; String [ ] names = new String [ namesVec . size ( ) ] ; namesVec . copyInto ( names ) ; Object [ ] args = new String [ argsVec . size ( ) ] ; argsVec . copyInto ( args ) ; try { if ( ! installedApplyMethod ) { interpreter . eval ( bsfApplyMethod ) ; installedApplyMethod = true ; } bsh . This global = ( bsh . This ) interpreter . get ( "global" ) ; return global . invokeMethod ( "_bsfApply" , new Object [ ] { names , args , ( String ) funcBody } ) ; } catch ( InterpreterError e ) { throw new BSFException ( "BeanShell interpreter internal error: " + e + sourceInfo ( source , lineNo , columnNo ) ) ; } catch ( TargetError e2 ) { throw new BSFException ( "The application script threw an exception: " + e2 . getTarget ( ) + sourceInfo ( source , lineNo , columnNo ) ) ; } catch ( EvalError e3 ) { throw new BSFException ( "BeanShell script error: " + e3 + sourceInfo ( source , lineNo , columnNo ) ) ; } }
target:  This is an implementation of the BSF apply() method. It executes the funcBody text in an "anonymous" method call with arguments.