if ( component instanceof SForm ) { form = component; } else {
if ( !(component instanceof SForm) ) {
    public static void fireEvents() {        List armedComponents = (List) threadArmedComponents.get();        try {            LowLevelEventListener component;            // handle form special, form event should be fired last            // hopefully there is only one form ;-)            LowLevelEventListener form = null;            Iterator iterator = armedComponents.iterator();            while (iterator.hasNext()) {                component = (LowLevelEventListener)iterator.next();                if ( component instanceof SForm ) {                    form = component;                } else {                    component.fireIntermediateEvents();                }            }            if ( form!=null ) {                form.fireIntermediateEvents();                form = null;            }            iterator = armedComponents.iterator();            while (iterator.hasNext()) {                component = (LowLevelEventListener)iterator.next();                if ( component instanceof SForm ) {                    form = component;                } else {                    component.fireFinalEvents();                }            }            if ( form!=null ) {                form.fireFinalEvents();                form = null;            }        }        finally {            armedComponents.clear();        }    }