ArrayList result = null; for (Iterator it = m_children.iterator(); it.hasNext(); ) { Child child = (Child) it.next(); if (child.getField().equals(field)) { if (field.getUpper() == 1) { return child.getNode(); } else { if (result == null) { result = new ArrayList(); } result.add(child.getNode()); }
ArrayList children = (ArrayList) m_fields.get(field); if (field.getUpper() == 1) { if (children == null) { return null; } else { return children.get(0); } } else if (children == null && (field.getUpper() > 1 || field.getUpper() < field.getLower())) { return Collections.EMPTY_LIST; } else { if (children == null) { throw new IllegalStateException ("returning null from collection field"); } else { return children;
    public Object get(Field field) {        check(field);        ArrayList result = null;        for (Iterator it = m_children.iterator(); it.hasNext(); ) {            Child child = (Child) it.next();            if (child.getField().equals(field)) {                if (field.getUpper() == 1) {                    return child.getNode();                } else {                    if (result == null) {                        result = new ArrayList();                    }                    result.add(child.getNode());                }            }        }        if (result == null &&            (field.getUpper() > 1 || field.getUpper() < field.getLower())) {            result = new ArrayList();        }        return result;    }