Program: 15840
Project: 15840
Buggy source:
public Object resolveVariable(XelContext ctx,Object base,Object onm){
  if (base != null) {
    Object o=((ExecutionCtrl)_exec).getExtraXelVariable(ctx,base,onm);
    if (o != null)     return o;
    final Page page=((ExecutionCtrl)_exec).getCurrentPage();
    return page != null ? page.getXelVariable(ctx,base,onm,true) : null;
  }
  if (onm == null)   return null;
  final String name=onm.toString();
  if (name == null || name.length() == 0)   return null;
  if ("String_Node_Str".equals(name))   return _exec.getArg();
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.COMPONENT_SCOPE);
    return Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getAttributes();
  if ("String_Node_Str".equals(name))   return _exec.getDesktop();
  if ("String_Node_Str".equals(name))   return _exec;
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.PAGE_SCOPE);
    if (_self instanceof Page)     return ((Page)_self).getAttributes();
    final Page page=((ExecutionCtrl)_exec).getCurrentPage();
    return page != null ? page.getAttributes() : Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return Components.getCurrentPage((Component)_self);
    if (_self instanceof Page)     return _self;
    return ((ExecutionCtrl)_exec).getCurrentPage();
  }
  if ("String_Node_Str".equals(name))   return _exec.getAttributes();
  if ("String_Node_Str".equals(name))   return _self;
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getSession().getAttributes();
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getSession();
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getSpaceOwner();
    if (_self instanceof Page)     return _self;
    return null;
  }
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.SPACE_SCOPE);
    if (_self instanceof Page)     return ((Page)_self).getAttributes();
    return Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name) || "String_Node_Str".equals(name))   return Evaluators.resolveVariable(_parent,name);
  if (_self instanceof Component) {
    final Component comp=(Component)_self;
    final Page page=Components.getCurrentPage(comp);
    if (page != null) {
      final Object o=page.getZScriptVariable(comp,name);
      if (o != null)       return o;
    }
    Object o=_exec.getAttribute(name);
    if (o != null)     return o;
    o=comp.getShadowVariable(name,true);
    if (o != null)     return o;
    o=comp.getAttributeOrFellow(name,true);
    if (o != null)     return o;
    o=((ExecutionCtrl)_exec).getExtraXelVariable(name);
    if (o != null)     return o;
    if (page != null) {
      o=page.getXelVariable(ctx,null,name,true);
      if (o != null)       return o;
    }
  }
 else {
    Page page;
    if (_self instanceof Page) {
      page=(Page)_self;
    }
 else {
      page=((ExecutionCtrl)_exec).getCurrentPage();
    }
    if (page != null) {
      Object o=page.getZScriptVariable(name);
      if (o != null)       return o;
      o=_exec.getAttribute(name);
      if (o != null)       return o;
      o=page.getAttributeOrFellow(name,true);
      if (o != null)       return o;
      o=((ExecutionCtrl)_exec).getExtraXelVariable(name);
      if (o != null)       return o;
      o=page.getXelVariable(ctx,null,name,true);
      if (o != null)       return o;
    }
 else {
      Object o=_exec.getAttribute(name,true);
      if (o != null)       return o;
    }
  }
  Object o=Evaluators.resolveVariable(_parent,name);
  if (o != null)   return o;
  if ("String_Node_Str".equals(name))   return Labels.getSegmentedLabels();
  return null;
}

Fixed version (ground truth):
public Object resolveVariable(XelContext ctx,Object base,Object onm){
  if (base != null) {
    Object o=((ExecutionCtrl)_exec).getExtraXelVariable(ctx,base,onm);
    if (o != null)     return o;
    final Page page=((ExecutionCtrl)_exec).getCurrentPage();
    return page != null ? page.getXelVariable(ctx,base,onm,true) : null;
  }
  if (onm == null)   return null;
  final String name=onm.toString();
  if (name == null || name.length() == 0)   return null;
  if ("String_Node_Str".equals(name))   return _exec.getArg();
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.COMPONENT_SCOPE);
    return Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getAttributes();
  if ("String_Node_Str".equals(name))   return _exec.getDesktop();
  if ("String_Node_Str".equals(name))   return _exec;
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.PAGE_SCOPE);
    if (_self instanceof Page)     return ((Page)_self).getAttributes();
    final Page page=((ExecutionCtrl)_exec).getCurrentPage();
    return page != null ? page.getAttributes() : Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return Components.getCurrentPage((Component)_self);
    if (_self instanceof Page)     return _self;
    return ((ExecutionCtrl)_exec).getCurrentPage();
  }
  if ("String_Node_Str".equals(name))   return _exec.getAttributes();
  if ("String_Node_Str".equals(name))   return _self;
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getSession().getAttributes();
  if ("String_Node_Str".equals(name))   return _exec.getDesktop().getSession();
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getSpaceOwner();
    if (_self instanceof Page)     return _self;
    return null;
  }
  if ("String_Node_Str".equals(name)) {
    if (_self instanceof Component)     return ((Component)_self).getAttributes(Component.SPACE_SCOPE);
    if (_self instanceof Page)     return ((Page)_self).getAttributes();
    return Collections.EMPTY_MAP;
  }
  if ("String_Node_Str".equals(name) || "String_Node_Str".equals(name))   return Evaluators.resolveVariable(_parent,name);
  if (_self instanceof Component) {
    final Component comp=(Component)_self;
    Page page=null;
    if (comp instanceof ShadowElement) {
      final Component host=((ShadowElement)comp).getShadowHost();
      page=Components.getCurrentPage(host);
      if (page != null) {
        final Object o=page.getZScriptVariable(host,name);
        if (o != null)         return o;
      }
    }
 else {
      page=Components.getCurrentPage(comp);
      if (page != null) {
        final Object o=page.getZScriptVariable(comp,name);
        if (o != null)         return o;
      }
    }
    Object o=_exec.getAttribute(name);
    if (o != null)     return o;
    o=comp.getShadowVariable(name,true);
    if (o != null)     return o;
    o=comp.getAttributeOrFellow(name,true);
    if (o != null)     return o;
    o=((ExecutionCtrl)_exec).getExtraXelVariable(name);
    if (o != null)     return o;
    if (page != null) {
      o=page.getXelVariable(ctx,null,name,true);
      if (o != null)       return o;
    }
  }
 else {
    Page page;
    if (_self instanceof Page) {
      page=(Page)_self;
    }
 else {
      page=((ExecutionCtrl)_exec).getCurrentPage();
    }
    if (page != null) {
      Object o=page.getZScriptVariable(name);
      if (o != null)       return o;
      o=_exec.getAttribute(name);
      if (o != null)       return o;
      o=page.getAttributeOrFellow(name,true);
      if (o != null)       return o;
      o=((ExecutionCtrl)_exec).getExtraXelVariable(name);
      if (o != null)       return o;
      o=page.getXelVariable(ctx,null,name,true);
      if (o != null)       return o;
    }
 else {
      Object o=_exec.getAttribute(name,true);
      if (o != null)       return o;
    }
  }
  Object o=Evaluators.resolveVariable(_parent,name);
  if (o != null)   return o;
  if ("String_Node_Str".equals(name))   return Labels.getSegmentedLabels();
  return null;
}