for (Iterator i=prototypes.values().iterator(); i.hasNext(); ) { Prototype proto = (Prototype) i.next ();  DbMapping dbmap = proto.getDbMapping (); if (dbmap != null && dbmap.needsUpdate ()) { dbmap.update (); if (proto != hopobjectProto && proto != globalProto) {  String parentName = dbmap.getExtends (); if (parentName != null) proto.setParentPrototype (getPrototype (parentName)); else if (!app.isJavaPrototype (proto.getName())) proto.setParentPrototype (hopobjectProto); } } }
    public void checkFiles () {	// long now = System.currentTimeMillis ();	// System.out.print ("checking prototypes for  "+app);	File[] list = appDir.listFiles ();	if (list == null)	    throw new RuntimeException ("Can't read app directory "+appDir+" - check permissions");	for (int i=0; i<list.length; i++) {	    String filename = list[i].getName ();	    Prototype proto = getPrototype (filename);	    // if prototype doesn't exist, create it	    if (proto == null) {	        // leave out ".." and other directories that contain "."	        if (filename.indexOf ('.') < 0 && list[i].isDirectory () && isValidTypeName (filename)) {	            // create new prototype	            proto = new Prototype (filename, app);	            registerPrototype (filename, list[i], proto);	            // give logger thread a chance to tell what's going on	            // Thread.yield();	        } else if (filename.toLowerCase().endsWith (".zip") && !list[i].isDirectory ()) {	            ZippedAppFile zipped = (ZippedAppFile) zipfiles.get (filename);	            if (zipped == null) {	                zipped = new ZippedAppFile (list[i], app);	                zipfiles.put (filename, zipped);	            }	        }	    }	}	// loop through prototypes and check if type.properties needs updates	// it's important that we do this _after_ potentially new prototypes 	// have been created in the previous loop.	for (Iterator i=prototypes.values().iterator(); i.hasNext(); ) {	    Prototype proto = (Prototype) i.next ();	    // update prototype's type mapping	    DbMapping dbmap = proto.getDbMapping ();	    if (dbmap != null && dbmap.needsUpdate ()) {	        dbmap.update ();	        // set parent prototype, in case it has changed.	        String parentName = dbmap.getExtends ();	        if (parentName != null)	            proto.setParentPrototype (getPrototype (parentName));	        else	            proto.setParentPrototype (null);	    }	}	// loop through zip files to check for updates	for (Iterator it=zipfiles.values ().iterator (); it.hasNext (); ) {	    ZippedAppFile zipped = (ZippedAppFile) it.next ();	    if (zipped.needsUpdate ()) {	        zipped.update ();	    }	}    }