if ( !( params[0] instanceof String ) ) {
throw new ELException( "The first argument to Formatter#format must be String" );
}
FormatterWrapper formatterWrapper = (FormatterWrapper) context.getVariableMapper()
.resolveVariable( FORMATTER )
.getValue( context );
Object[] formattingParameters = new Object[params.length - 1];
System.arraycopy( params, 1, formattingParameters, 0, params.length - 1 );
Object returnValue;
try {
returnValue = formatterWrapper.format( (String) params[0], formattingParameters );
context.setPropertyResolved( true );
}
catch ( IllegalFormatException e ) {
throw new ELException( "Error in Formatter#format call", e );
}