if (_localSourceObject() instanceof EOEnterpriseObject && hasKeyPath()) {
if (_localSourceObjectIsEO() && hasKeyPath()) {
    protected Object _localRelativeSourceObject() {        Object relativeSourceObject = null;        if (_localSourceObject() instanceof EOEnterpriseObject && hasKeyPath()) {            String partialKeyPath=ERXStringUtilities.keyPathWithoutLastProperty(_localRelationshipKey());            relativeSourceObject = ((EOEnterpriseObject)_localSourceObject()).valueForKeyPath(partialKeyPath);        }        return relativeSourceObject != null ? relativeSourceObject : _localSourceObject();    }