while (it.hasNext()) {
for (Iterator it = list.iterator(); it.hasNext(); count++) {
    public static EsriGraphicList getEsriGraphicList(                                                     URL shp,                                                     URL shx,                                                     DrawingAttributes drawingAttributes,                                                     DbfTableModel dbf) {        EsriGraphicList list = null;        ShxInputStream xis;        int[][] indexData = null;        try {            InputStream is = shx.openStream();            xis = new ShxInputStream(is);            indexData = xis.getIndex();            is.close();        } catch (Exception e) {            Debug.error("EsriGraphicList: Unable to stream SHX file");            if (Debug.debugging("shape")) {                e.printStackTrace();            }            return null;        }        //Open and stream shp file        try {            InputStream is = shp.openStream();            ShpInputStream pis = new ShpInputStream(is);            if (drawingAttributes != null) {                pis.setDrawingAttributes(drawingAttributes);            }            list = pis.getGeometry(indexData);            is.close();        } catch (Exception e) {            Debug.error("EsriGraphicList: Not able to stream SHP file");            if (Debug.debugging("shape")) {                e.printStackTrace();            }            return null;        }        if (list != null && dbf != null && dbf.getRowCount() == list.size()) {            list.setTable(dbf);            java.util.Iterator it = list.iterator();            int count = 0;            while (it.hasNext()) {                OMGraphic graphic = (OMGraphic) it.next();                graphic.setAppObject(dbf.getRecord(count++));            }        }        return list;    }