Iterator it = instance.nets.keySet().iterator(); while (it.hasNext()) { String netName = (String)it.next(); GnutellaNet net = (GnutellaNet)instance.nets.get(netName); HashMap map = net.getURLs(); Iterator it1 = map.keySet().iterator(); while (it1.hasNext()) { String url = (String)it1.next(); RemoteURL u = (RemoteURL)map.get(url); String cv = u.getCacheVersion(); if (cv.equals(RemoteURL.STATE_QUEUED)) instance.addUrlForVerification(u); if (cv.equals(RemoteURL.STATE_CHECKING)) instance.addUrlForVerification(u);
synchronized (instance) { Iterator it = instance.nets.keySet().iterator(); while (it.hasNext()) { String netName = (String)it.next(); GnutellaNet net = (GnutellaNet)instance.nets.get(netName); HashMap map = net.getURLs(); Iterator it1 = map.keySet().iterator(); while (it1.hasNext()) { String url = (String)it1.next(); RemoteURL u = (RemoteURL)map.get(url); String cv = u.getCacheVersion(); if (cv.equals(RemoteURL.STATE_QUEUED)) instance.addUrlForVerification(u); if (cv.equals(RemoteURL.STATE_CHECKING)) instance.addUrlForVerification(u); }
    public synchronized static void readData(ServletContext context) {        Data newData = null;        try {            ObjectInputStream i = new ObjectInputStream(                                    new FileInputStream(dataFile(context)));            newData = (Data)i.readObject();            i.close();            newData.verifyList = new LinkedList();        } catch (FileNotFoundException e) {            context.log("no data file");        } catch (Exception e) {            context.log("readData", e);        }        if (newData == null)            newData = new Data();        instance = newData;        Iterator it = instance.nets.keySet().iterator();        while (it.hasNext()) {            String netName = (String)it.next();            GnutellaNet net = (GnutellaNet)instance.nets.get(netName);            HashMap map = net.getURLs();            Iterator it1 = map.keySet().iterator();            while (it1.hasNext()) {                String url = (String)it1.next();                RemoteURL u = (RemoteURL)map.get(url);                String cv = u.getCacheVersion();                if (cv.equals(RemoteURL.STATE_QUEUED))                    instance.addUrlForVerification(u);                if (cv.equals(RemoteURL.STATE_CHECKING))                    instance.addUrlForVerification(u);            }        }    }