result.add(info.buffer);
if (info.bufferSize > 0) { result.add(info.buffer); }
    private static JFieldDeclaration[] getFields(List filterInfo) {        // make result        List result = new LinkedList();        // add the buffer's and the list of fields from each filter        int i=0;        for (ListIterator it = filterInfo.listIterator(); it.hasNext(); i++) {            FilterInfo info = (FilterInfo)it.next();            // ignore buffer and pop index for first filter, as it            // reads from the input with peek/pop operations            if (i!=0) {                result.add(info.buffer);                result.add(info.popIndex);            }            // don't add push counter for last filter, as it writes            // directly            if (it.hasNext()) {                result.add(info.pushIndex);            }            result.addAll(Arrays.asList(info.filter.getFields()));        }        // return result        return (JFieldDeclaration[])result.toArray(new JFieldDeclaration[0]);    }