public static Method getFunction ( String functionName ) { Method method = FUNCTION_MAP . get ( functionName ) ; if ( method != null ) { return method ; } String nameLower = functionName . toLowerCase ( Locale . US ) ; if ( nameLower == functionName ) { // Input name was in lower case, the function is not there return null ; } method = FUNCTION_MAP . get ( nameLower ) ; if ( method != null && FUNCTION_MAP . size ( ) < 1000 ) { // Avoid OutOfMemoryError in case input function names are randomized // The number of methods is finite, however the number of upper-lower case combinations // is quite a few (e.g. substr, Substr, sUbstr, SUbstr, etc). FUNCTION_MAP . putIfAbsent ( functionName , method ) ; } return method ; }
get Method object implementing the given function