boolean _raiseOnMissingEditingContextDelegate = ERXProperties.booleanForKeyWithDefault("er.extensions.ERXRaiseOnMissingEditingContextDelegate", true);
    public static boolean _checkEditingContextDelegate(EOEditingContext editingContext) {        if(editingContext instanceof ERXEC) {            return true;        }        Object delegate=editingContext.delegate();                if (delegate==null) {            EOObjectStore parent = editingContext.parentObjectStore();            if(!_raiseOnMissingEditingContextDelegate && parent != null && parent instanceof EOEditingContext) {                Object parentDelegate=((EOEditingContext)parent).delegate();                if(parentDelegate != null && (parentDelegate instanceof ERXEditingContextDelegate)) {                    editingContext.setDelegate(parentDelegate);                    log.info("Found null delegate. Setting to the parent's delegate.");                    return true;                }            }            if(!_raiseOnMissingEditingContextDelegate) {                log.warn("Found null delegate. I will fix this for now by setting it to ERXExtensions.defaultDelegate");                ERXEC.factory().setDefaultDelegateOnEditingContext(editingContext);                return true;            } else {                throw new IllegalStateException("Found null delegate. You can disable this check by setting er.extensions.ERXRaiseOnMissingEditingContextDelegate=false in your WebObjects.properties");            }        }        if (delegate!=null && !(delegate instanceof ERXEditingContextDelegate)) {            if(!_raiseOnMissingEditingContextDelegate) {                log.warn("Found unexpected delegate class: "+delegate.getClass().getName());                return true;            } else {                throw new IllegalStateException("Found unexpected delegate class. You can disable this check by setting er.extensions.ERXRaiseOnMissingEditingContextDelegate=false in your WebObjects.properties");            }        }        return false;            }