Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

All snippets
Create a snippet
Full search

Quick search:


Editing Snippet ID: #1022095
Snippet name:
Category, Type:
Content:
static O call_withVarargs(O o, S method, O... args) ctex { if (o == null) null; if (o instanceof Class) { Class c = (Class) o; _MethodCache cache = callOpt_getCache(c); Method me = cache.findStaticMethod(method, args); if (me != null) ret invokeMethod(me, null, args); // try varargs L<Method> methods = cache.cache.get(method); if (methods != null) methodSearch: for (Method m : methods) { continue unless m.isVarArgs(); continue unless isStaticMethod(m); O[] newArgs = massageArgsForVarArgsCall(m, args); if (newArgs != null) ret invokeMethod(m, null, newArgs); } fail("Method " + c.getName() + "." + method + "(" + joinWithComma(classNames(args)) + ") not found"); } else { Class c = o.getClass(); _MethodCache cache = callOpt_getCache(c); Method me = cache.findMethod(method, args); if (me != null) ret invokeMethod(me, o, args); // try varargs L<Method> methods = cache.cache.get(method); if (methods != null) methodSearch: for (Method m : methods) { continue unless m.isVarArgs(); O[] newArgs = massageArgsForVarArgsCall(m, args); if (newArgs != null) ret invokeMethod(m, o, newArgs); } fail("Method " + c.getName() + "." + method + "(" + joinWithComma(classNames(args)) + ") not found"); } }
Comment:
Public (visible to everyone):
Created: 2019-03-07 20:12:24

This page without fancy editor.