Example #1
0
  @Override
  public Object get(Collection.Key key) throws ExpressionException {
    /*if(NullSupportHelper.full()) {
    	Object o=super.get(key,NullSupportHelper.NULL());
    	if(o!=NullSupportHelper.NULL())return o;

    	o=get(Caster.toIntValue(key.getString(),-1),NullSupportHelper.NULL());
    	if(o!=NullSupportHelper.NULL())return o;
    	throw new ExpressionException("key ["+key.getString()+"] doesn't exist in argument scope. existing keys are ["+
    			lucee.runtime.type.List.arrayToList(CollectionUtil.keys(this),", ")
    			+"]");
    }*/

    // null is supported as returned value with argument scope
    Object o = super.g(key, Null.NULL);
    if (o != Null.NULL) return o;

    o = get(Caster.toIntValue(key.getString(), -1), Null.NULL);
    if (o != Null.NULL) return o;

    throw new ExpressionException(
        "key ["
            + key.getString()
            + "] doesn't exist in argument scope. existing keys are ["
            + lucee.runtime.type.util.ListUtil.arrayToList(CollectionUtil.keys(this), ", ")
            + "]");
  }