if (upd.needsUpdate ())
if (upd.needsUpdate ()) {
    public void updatePrototype (String name, File dir, Prototype proto) {        // app.logEvent ("updating prototype "+name);        boolean needsUpdate = false;        // our plan is to do as little as possible, so first check if anything has changed at all...        for (Iterator i = proto.updatables.values().iterator(); i.hasNext(); ) {	Updatable upd = (Updatable) i.next();	if (upd.needsUpdate ())	    needsUpdate = true;        }        String list[] = dir.list();        for (int i=0; i<list.length; i++) {	String fn = list[i];	if (!proto.updatables.containsKey (fn)) {	    if (fn.endsWith (app.templateExtension) || fn.endsWith (app.scriptExtension) ||	    fn.endsWith (app.actionExtension) || fn.endsWith (app.scriptExtension) || "type.properties".equalsIgnoreCase (fn))	        needsUpdate = true;	}        }        if (!needsUpdate)	return;        // let the thread know we had to do something.        idleSeconds = 0;        // first go through new files and create new items        for (int i=0; i<list.length; i++) {            String fn = list[i];            int dot = fn.indexOf (".");            if (dot < 0)                continue;            if (proto.updatables.containsKey (fn) || !(fn.endsWith (app.templateExtension) || fn.endsWith (app.scriptExtension) ||            fn.endsWith (app.actionExtension) || fn.endsWith (app.skinExtension) || "type.properties".equalsIgnoreCase (fn))) {                continue;            }            String tmpname = list[i].substring(0, dot);            File tmpfile = new File (dir, list[i]);            if (list[i].endsWith (app.templateExtension)) {                try {                    Template t = new Template (tmpfile, tmpname, proto);                    proto.updatables.put (list[i], t);                    proto.templates.put (tmpname, t);                } catch (Throwable x) {                    app.logEvent ("Error updating prototype: "+x);                }            } else if (list[i].endsWith (app.scriptExtension) && tmpfile.length () > 0) {                try {                    FunctionFile ff = new FunctionFile (tmpfile, tmpname, proto);                    proto.updatables.put (list[i], ff);                    proto.functions.put (tmpname, ff);                } catch (Throwable x) {                    app.logEvent ("Error updating prototype: "+x);                }            }  else if (list[i].endsWith (app.actionExtension) && tmpfile.length () > 0) {                try {                    Action af = new Action (tmpfile, tmpname, proto);                    proto.updatables.put (list[i], af);                    proto.actions.put (tmpname, af);                } catch (Throwable x) {                    app.logEvent ("Error updating prototype: "+x);                }            }  else if (list[i].endsWith (app.skinExtension)) {                SkinFile sf = new SkinFile (tmpfile, tmpname, proto);                proto.updatables.put (list[i], sf);                proto.skins.put (tmpname, sf);            }        }        // next go through existing updatables        for (Iterator i = proto.updatables.values().iterator(); i.hasNext(); ) {            Updatable upd = (Updatable) i.next();            if (upd.needsUpdate ()) {                if (upd instanceof DbMapping)                    rewire = true;                try {                    upd.update ();                } catch (Exception x) {                     if (upd instanceof DbMapping)	            app.logEvent ("Error updating db mapping for type "+name+": "+x);                     else	            app.logEvent ("Error updating "+upd+" of prototye type "+name+": "+x);                }            }        }    }