if (resources != null)
if (resources != null) { resources = new HashMap(); } else {
    public synchronized void update() {        if (!directory.exists()) {            repositories = new Repository[0];            if (resources != null)                resources.clear();            lastModified = 0;            return;        }        if (directory.lastModified() != lastModified) {            lastModified = directory.lastModified();            File[] list = directory.listFiles();            ArrayList newRepositories = new ArrayList(list.length);            HashMap newResources = new HashMap(list.length);            for (int i = 0; i < list.length; i++) {                if (list[i].isDirectory()) {                    // a nested directory aka child file repository                    newRepositories.add(new FileRepository(list[i], this));                } else if (list[i].getName().endsWith(".zip")) {                    // a nested zip repository                    newRepositories.add(new ZipRepository(list[i], this));                } else if (list[i].isFile()) {                    // a file resource                    FileResource resource = new FileResource(list[i], this);                    newResources.put(resource.getShortName(), resource);                }            }            repositories = (Repository[])                    newRepositories.toArray(new Repository[newRepositories.size()]);            resources = newResources;        }    }