/** * Utility to convert a List into an Object[] array. If the list is zero elements this will * return a constant array; toArray() on List always returns a new object and this is wasteful * for our purposes. */ public static Object[] toArray(List list) { Object[] result; int size = list.size(); if (size == 0) { result = NoArguments; } else { result = getObjectArrayPool().create(list.size()); for (int i = 0; i < size; i++) { result[i] = list.get(i); } } return result; }
/** * Utility to convert a List into an Object[] array. If the list is zero elements this will * return a constant array; toArray() on List always returns a new object and this is wasteful * for our purposes. */ public static Object[] toArray(List list) { Object[] result; int size = list.size(); if (size == 0) { result = NoArguments; } else { result = getObjectArrayPool().create(list.size()); for (int i = 0; i < size; i++) { result[i] = list.get(i); } } return result; }
/** Utility to convert a List into an Object[] array. If the list is zero elements this will return a constant array; toArray() on List always returns a new object and this is wasteful for our purposes. */ public static Object[] toArray(List list) { Object[] result; int size = list.size(); if (size == 0) { result = NoArguments; } else { result = getObjectArrayPool().create(list.size()); for (int i = 0; i < size; i++) { result[i] = list.get(i); } } return result; }
protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for ( int i=0, icount = args.length; i < icount; ++i ) args[i] = children[i].getValue(context, root); return OgnlRuntime.callStaticMethod( context, className, methodName, args ); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for(int i = 0, icount = args.length; i < icount; ++i) args[i] = _children[i].getValue(context, root); return OgnlRuntime.callStaticMethod(context, _className, _methodName, args); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for(int i = 0, icount = args.length; i < icount; ++i) args[i] = _children[i].getValue(context, root); return OgnlRuntime.callStaticMethod(context, _className, _methodName, args); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
root = context.getRoot(); int count = jjtGetNumChildren(); Object[] args = OgnlRuntime.getObjectArrayPool().create(count); OgnlRuntime.getObjectArrayPool().recycle(args);
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); try { Object result, root = context.getRoot(); for(int i = 0, icount = args.length; i < icount; ++i) { args[i] = _children[i].getValue(context, root); } result = OgnlRuntime.callMethod(context, source, _methodName, args); if (result == null) { NullHandler nh = OgnlRuntime.getNullHandler(OgnlRuntime.getTargetClass(source)); result = nh.nullMethodResult(context, source, _methodName, args); } return result; } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
Object[] args = OgnlRuntime.getObjectArrayPool().create(count); OgnlRuntime.getObjectArrayPool().recycle(args);
Object[] args = OgnlRuntime.getObjectArrayPool().create(count); OgnlRuntime.getObjectArrayPool().recycle(args);
protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); try { Object result, root = context.getRoot(); for ( int i = 0, icount = args.length; i < icount; ++i ) { args[i] = children[i].getValue(context, root); } result = OgnlRuntime.callMethod( context, source, methodName, null, args); if (result == null) { NullHandler nh = OgnlRuntime.getNullHandler(OgnlRuntime.getTargetClass(source)); result = nh.nullMethodResult(context, source, methodName, args); } return result; } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); try { Object result, root = context.getRoot(); for(int i = 0, icount = args.length; i < icount; ++i) { args[i] = _children[i].getValue(context, root); } result = OgnlRuntime.callMethod(context, source, _methodName, args); if (result == null) { NullHandler nh = OgnlRuntime.getNullHandler(OgnlRuntime.getTargetClass(source)); result = nh.nullMethodResult(context, source, _methodName, args); } return result; } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }