nus-yam/ex-repair huggingface dataset:
Program: 16414
Project: 16414
Buggy source:
public void afterComponentAttached(Component comp,Page page){
  if (comp.getDesktop() != null) {
    final Binder selfBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
    if (selfBinder == null) {
      final Binder binder=(Binder)comp.getAttribute(BinderImpl.BINDER,true);
      if (binder != null) {
        comp.addEventListener(10000,ON_BIND_INIT,new EventListener<Event>(){
          @Override public void onEvent(          Event event) throws Exception {
            final Component comp=event.getTarget();
            comp.removeEventListener(ON_BIND_INIT,this);
            final BinderImpl binder=(BinderImpl)event.getData();
            new AnnotateBinderHelper(binder).initComponentBindings(comp);
            binder.loadComponent(comp);
          }
        }
);
        Events.postEvent(new Event(ON_BIND_INIT,comp,binder));
      }
    }
  }
}

Fixed version (ground truth):
public void afterComponentAttached(Component comp,Page page){
  if (comp.getDesktop() != null) {
    final Binder selfBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
    if (selfBinder == null) {
      final Binder binder=(Binder)comp.getAttribute(BinderImpl.BINDER,true);
      if (binder != null) {
        comp.addEventListener(10000,ON_BIND_INIT,new EventListener<Event>(){
          @Override public void onEvent(          Event event) throws Exception {
            final Component comp=event.getTarget();
            comp.removeEventListener(ON_BIND_INIT,this);
            if (comp.getParent() == null || comp.getPage() == null) {
              return;
            }
            final Binder innerBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
            final BinderImpl binder=(BinderImpl)event.getData();
            if (innerBinder != null && innerBinder != binder) {
              return;
            }
            new AnnotateBinderHelper(binder).initComponentBindings(comp);
            binder.loadComponent(comp);
          }
        }
);
        Events.postEvent(new Event(ON_BIND_INIT,comp,binder));
      }
    }
  }
}
Program: 16415
Project: 16415
Buggy source:
@Override public void onEvent(Event event) throws Exception {
  final Component comp=event.getTarget();
  comp.removeEventListener(ON_BIND_INIT,this);
  final BinderImpl binder=(BinderImpl)event.getData();
  new AnnotateBinderHelper(binder).initComponentBindings(comp);
  binder.loadComponent(comp);
}

Fixed version (ground truth):
@Override public void onEvent(Event event) throws Exception {
  final Component comp=event.getTarget();
  comp.removeEventListener(ON_BIND_INIT,this);
  if (comp.getParent() == null || comp.getPage() == null) {
    return;
  }
  final Binder innerBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
  final BinderImpl binder=(BinderImpl)event.getData();
  if (innerBinder != null && innerBinder != binder) {
    return;
  }
  new AnnotateBinderHelper(binder).initComponentBindings(comp);
  binder.loadComponent(comp);
}
Program: 16416
Project: 16416
Buggy source:
public Object coerceToBean(Object val,Component component,BindContext ctx){
  Calendar adultDay=Calendar.getInstance();
  adultDay.setTime((Date)val);
  adultDay.add(Calendar.YEAR,18);
  Calendar now=Calendar.getInstance();
  if (now.after(adultDay)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public Object coerceToBean(Object val,Component component,BindContext ctx){
  boolean isAdult=false;
  if (val != null) {
    Calendar adultDay=Calendar.getInstance();
    adultDay.setTime((Date)val);
    adultDay.add(Calendar.YEAR,18);
    Calendar now=Calendar.getInstance();
    if (now.after(adultDay)) {
      isAdult=true;
    }
  }
  return isAdult;
}
Program: 16417
Project: 16417
Buggy source:
private void cloneListeners(AbstractComponent owner,AuxInfo clone){
  if (listeners != null) {
    clone.listeners=new HashMap<String,List<EventListenerInfo>>(4);
    for (    Map.Entry<String,List<EventListenerInfo>> me : listeners.entrySet()) {
      final List<EventListenerInfo> list=new LinkedList<EventListenerInfo>();
      for (      EventListenerInfo val : list) {
        if (val instanceof ComponentCloneListener) {
          val=(EventListenerInfo)((ComponentCloneListener)val).willClone(owner);
          if (val == null)           continue;
        }
        list.add(val);
      }
      if (!list.isEmpty())       clone.listeners.put(me.getKey(),list);
    }
  }
}

Fixed version (ground truth):
private void cloneListeners(AbstractComponent owner,AuxInfo clone){
  if (listeners != null) {
    clone.listeners=new HashMap<String,List<EventListenerInfo>>(4);
    for (    Map.Entry<String,List<EventListenerInfo>> me : listeners.entrySet()) {
      final List<EventListenerInfo> list=new LinkedList<EventListenerInfo>();
      for (      EventListenerInfo val : me.getValue()) {
        if (val instanceof ComponentCloneListener) {
          val=(EventListenerInfo)((ComponentCloneListener)val).willClone(owner);
          if (val == null)           continue;
        }
        list.add(val);
      }
      if (!list.isEmpty())       clone.listeners.put(me.getKey(),list);
    }
  }
}
Program: 16418
Project: 16418
Buggy source:
private void addLoadFormBinding(Component comp,String formid,Form form,String loadExpr,Map<String,Object> args){
  final LoadFormBindingImpl binding=new LoadFormBindingImpl(this,comp,form,loadExpr,args);
  final String attr=formid;
  addBinding(comp,attr,binding);
  final String command=binding.getCommandName();
  if (command == null) {
    final String bindDualId=getBindDualId(comp,attr);
    addLoadFormPromptBinding(bindDualId,binding);
  }
 else {
    final boolean after=binding.isAfter();
    if (after) {
      addLoadFormAfterBinding(command,binding);
    }
 else {
      addLoadFormBeforeBinding(command,binding);
    }
  }
}

Fixed version (ground truth):
private void addLoadFormBinding(Component comp,String formid,Form form,String loadExpr,Map<String,Object> args){
  final LoadFormBindingImpl binding=new LoadFormBindingImpl(this,comp,formid,form,loadExpr,args);
  final String attr=formid;
  addBinding(comp,attr,binding);
  final String command=binding.getCommandName();
  if (command == null) {
    final String bindDualId=getBindDualId(comp,attr);
    addLoadFormPromptBinding(bindDualId,binding);
  }
 else {
    final boolean after=binding.isAfter();
    if (after) {
      addLoadFormAfterBinding(command,binding);
    }
 else {
      addLoadFormBeforeBinding(command,binding);
    }
  }
}
Program: 16419
Project: 16419
Buggy source:
private void addSaveFormBinding(Component comp,String formid,Form form,String saveExpr,String validator,Map<String,Object> args,Map<String,Object> validatorArgs){
  final SaveFormBindingImpl binding=new SaveFormBindingImpl(this,comp,form,saveExpr,validator,args,validatorArgs);
  final String command=binding.getCommandName();
  if (command == null) {
    throw new UiException("String_Node_Str" + formid + "String_Node_Str"+ binding.getPropertyString());
  }
  addBinding(comp,formid,binding);
  final boolean after=binding.isAfter();
  if (after) {
    addSaveFormAfterBinding(command,binding);
  }
 else {
    addSaveFormBeforeBinding(command,binding);
  }
}

Fixed version (ground truth):
private void addSaveFormBinding(Component comp,String formid,Form form,String saveExpr,String validator,Map<String,Object> args,Map<String,Object> validatorArgs){
  final SaveFormBindingImpl binding=new SaveFormBindingImpl(this,comp,formid,form,saveExpr,validator,args,validatorArgs);
  final String command=binding.getCommandName();
  if (command == null) {
    throw new UiException("String_Node_Str" + formid + "String_Node_Str"+ binding.getPropertyString());
  }
  addBinding(comp,formid,binding);
  final boolean after=binding.isAfter();
  if (after) {
    addSaveFormAfterBinding(command,binding);
  }
 else {
    addSaveFormBeforeBinding(command,binding);
  }
}
Program: 16420
Project: 16420
Buggy source:
protected FormBindingImpl(Binder binder,Component comp,Form form,String accessScript,Map<String,Object> args){
  super(binder,comp,args);
  this._form=form;
  this._accessInfo=AccessInfo.create(this,accessScript,Form.class,ignoreTracker());
  _fieldExprs=new HashMap<String,ExpressionX>();
}

Fixed version (ground truth):
protected FormBindingImpl(Binder binder,Component comp,String formId,Form form,String accessScript,Map<String,Object> args){
  super(binder,comp,args);
  this._formId=formId;
  this._form=form;
  this._accessInfo=AccessInfo.create(this,accessScript,Form.class,ignoreTracker());
  _fieldExprs=new HashMap<String,ExpressionX>();
}
Program: 16421
Project: 16421
Buggy source:
public LoadFormBindingImpl(Binder binder,Component comp,Form form,String loadExpr,Map<String,Object> args){
  super(binder,comp,form,loadExpr,args);
}

Fixed version (ground truth):
public LoadFormBindingImpl(Binder binder,Component comp,String formId,Form form,String loadExpr,Map<String,Object> args){
  super(binder,comp,formId,form,loadExpr,args);
}
Program: 16422
Project: 16422
Buggy source:
public SaveFormBindingImpl(Binder binder,Component comp,Form form,String access,String validator,Map<String,Object> args,Map<String,Object> validatorArgs){
  super(binder,comp,form,access,args);
  final BindEvaluatorX eval=binder.getEvaluatorX();
  _validator=validator == null ? null : parseValidator(eval,validator);
  _validatorArgs=validatorArgs;
}

Fixed version (ground truth):
public SaveFormBindingImpl(Binder binder,Component comp,String formId,Form form,String access,String validator,Map<String,Object> args,Map<String,Object> validatorArgs){
  super(binder,comp,formId,form,access,args);
  final BindEvaluatorX eval=binder.getEvaluatorX();
  _validator=validator == null ? null : parseValidator(eval,validator);
  _validatorArgs=validatorArgs;
}
Program: 16423
Project: 16423
Buggy source:
private boolean validateSaveFormBinding(Component comp,SaveFormBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  if (!binding.hasValidator())   return true;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return vContext.isValid();
}

Fixed version (ground truth):
private boolean validateSaveFormBinding(Component comp,SaveFormBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  Set<SaveBinding> savebindings=binding.getBinder().getTracker().getFormSaveBinding(binding.getComponent(),binding.getFormId());
  boolean svalid=true;
  for (  SaveBinding sbinding : savebindings) {
    if (sbinding instanceof SavePropertyBinding) {
      svalid&=validateSavePropertyBinding(comp,((SavePropertyBinding)sbinding),command,validates,svalid & valid,notifys);
    }
 else {
    }
  }
  if (!binding.hasValidator())   return svalid;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,svalid & valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return svalid & vContext.isValid();
}
Program: 16424
Project: 16424
Buggy source:
private void collectSaveFormBinding(Component comp,SaveFormBinding binding,String command,Event evt,Set<Property> validates){
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),evt);
  Set<Property> cp=new HashSet<Property>();
  Property p=binding.getValidate(ctx);
  _mainPropertyCache.put(binding,p);
  cp.add(p);
  cp.addAll(binding.getValidates(ctx));
  validates.addAll(cp);
}

Fixed version (ground truth):
private void collectSaveFormBinding(Component comp,SaveFormBinding binding,String command,Event evt,Set<Property> validates){
  Set<SaveBinding> savebindings=binding.getBinder().getTracker().getFormSaveBinding(binding.getComponent(),binding.getFormId());
  for (  SaveBinding sbinding : savebindings) {
    if (sbinding instanceof SavePropertyBinding) {
      collectSavePropertyBinding(comp,((SavePropertyBinding)sbinding),command,evt,validates);
    }
 else {
    }
  }
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),evt);
  Set<Property> cp=new HashSet<Property>();
  Property p=binding.getValidate(ctx);
  _mainPropertyCache.put(binding,p);
  cp.add(p);
  cp.addAll(binding.getValidates(ctx));
  validates.addAll(cp);
}
Program: 16425
Project: 16425
Buggy source:
public void removeTrackings(Component comp){
  final Map<Object,TrackerNode> nodesMap=_compMap.remove(comp);
  if (nodesMap != null) {
    final Set<TrackerNode> removed=new HashSet<TrackerNode>();
    final Collection<TrackerNode> nodes=nodesMap.values();
    for (    TrackerNode node : nodes) {
      removed.add(node);
      removed.addAll(node.getDependents());
    }
    removeNodes(_beanMap.values(),removed);
    removeNodes(_nullMap.values(),removed);
  }
}

Fixed version (ground truth):
public void removeTrackings(Component comp){
  final Map<Object,TrackerNode> nodesMap=_compMap.remove(comp);
  if (nodesMap != null) {
    final Set<TrackerNode> removed=new HashSet<TrackerNode>();
    final Collection<TrackerNode> nodes=nodesMap.values();
    for (    TrackerNode node : nodes) {
      removed.add(node);
      removed.addAll(node.getDependents());
    }
    removeNodes(_beanMap.values(),removed);
    removeNodes(_nullMap.values(),removed);
  }
  removeFormTrackings(comp);
}
Program: 16427
Project: 16427
Buggy source:
private void initAllComponentsBindings(Component comp){
  final Binder selfBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
  if (selfBinder != null)   return;
  initFormBindings(comp);
  initComponentPropertiesBindings(comp);
  for (final Iterator<Component> it=comp.getChildren().iterator(); it.hasNext(); ) {
    final Component kid=(Component)it.next();
    initAllComponentsBindings(kid);
  }
}

Fixed version (ground truth):
private void initAllComponentsBindings(Component comp){
  final Binder selfBinder=(Binder)comp.getAttribute(BinderImpl.BINDER);
  if (selfBinder != null)   return;
  initFormBindings(comp);
  initComponentPropertiesBindings(comp);
  for (final Iterator<Component> it=comp.getChildren().iterator(); it.hasNext(); ) {
    final Component kid=it.next();
    initAllComponentsBindings(kid);
  }
}
Program: 16428
Project: 16428
Buggy source:
private void initCommandBindings(Component comp,String propName){
  final ComponentCtrl compCtrl=(ComponentCtrl)comp;
  final Annotation ann=compCtrl.getAnnotation(propName,BIND_ANNO);
  if (ann != null) {
    final Map<?,?> attrs=ann.getAttributes();
    Map<String,Object> args=null;
    final List<String> cmdExprs=new ArrayList<String>();
    for (final Iterator<?> it=attrs.entrySet().iterator(); it.hasNext(); ) {
      final Map.Entry entry=(Map.Entry)it.next();
      final String tag=(String)entry.getKey();
      final Object tagExpr=entry.getValue();
      if ("String_Node_Str".equals(tag)) {
        if (tagExpr instanceof String[]) {
          throw new UiException("String_Node_Str");
        }
        cmdExprs.add((String)tagExpr);
      }
 else {
        if (args == null) {
          args=new HashMap<String,Object>();
        }
        args.put(tag,tagExpr);
      }
    }
    args=args == null ? null : parsedArgs(args);
    for (    String cmd : cmdExprs) {
      _binder.addCommandBinding(comp,propName,cmd,args);
    }
  }
}

Fixed version (ground truth):
private void initCommandBindings(Component comp,String propName){
  final ComponentCtrl compCtrl=(ComponentCtrl)comp;
  final Annotation ann=compCtrl.getAnnotation(propName,BIND_ANNO);
  if (ann != null) {
    final Map<String,Object> attrs=ann.getAttributes();
    Map<String,Object> args=null;
    final List<String> cmdExprs=new ArrayList<String>();
    for (final Iterator<Entry<String,Object>> it=attrs.entrySet().iterator(); it.hasNext(); ) {
      final Entry<String,Object> entry=it.next();
      final String tag=(String)entry.getKey();
      final Object tagExpr=entry.getValue();
      if ("String_Node_Str".equals(tag)) {
        if (tagExpr instanceof String[]) {
          throw new UiException("String_Node_Str");
        }
        cmdExprs.add((String)tagExpr);
      }
 else {
        if (args == null) {
          args=new HashMap<String,Object>();
        }
        args.put(tag,tagExpr);
      }
    }
    args=args == null ? null : parsedArgs(args);
    for (    String cmd : cmdExprs) {
      _binder.addCommandBinding(comp,propName,cmd,args);
    }
  }
}
Program: 16431
Project: 16431
Buggy source:
private ValidatorInfo parseValidator(ComponentCtrl compCtrl,Annotation anno){
  ValidatorInfo info=new ValidatorInfo();
  for (final Iterator<?> it=anno.getAttributes().entrySet().iterator(); it.hasNext(); ) {
    final Map.Entry entry=(Map.Entry)it.next();
    final String tag=(String)entry.getKey();
    final Object tagExpr=entry.getValue();
    if ("String_Node_Str".equals(tag)) {
      info.expr=(String)tagExpr;
    }
 else {
      if (info.args == null) {
        info.args=new HashMap<String,Object>();
      }
      info.args.put(tag,tagExpr);
    }
  }
  if (Strings.isBlank(info.expr)) {
    throw new UiException("String_Node_Str");
  }
  info.args=info.args == null ? null : parsedArgs(info.args);
  return info;
}

Fixed version (ground truth):
private ValidatorInfo parseValidator(ComponentCtrl compCtrl,Annotation anno){
  ValidatorInfo info=new ValidatorInfo();
  for (final Iterator<Entry<String,Object>> it=anno.getAttributes().entrySet().iterator(); it.hasNext(); ) {
    final Entry<String,Object> entry=it.next();
    final String tag=(String)entry.getKey();
    final Object tagExpr=entry.getValue();
    if ("String_Node_Str".equals(tag)) {
      info.expr=(String)tagExpr;
    }
 else {
      if (info.args == null) {
        info.args=new HashMap<String,Object>();
      }
      info.args.put(tag,tagExpr);
    }
  }
  if (Strings.isBlank(info.expr)) {
    throw new UiException("String_Node_Str");
  }
  info.args=info.args == null ? null : parsedArgs(info.args);
  return info;
}
Program: 16432
Project: 16432
Buggy source:
private ConverterInfo parseConverter(ComponentCtrl compCtrl,Annotation anno){
  ConverterInfo info=new ConverterInfo();
  for (final Iterator<?> it=anno.getAttributes().entrySet().iterator(); it.hasNext(); ) {
    final Map.Entry entry=(Map.Entry)it.next();
    final String tag=(String)entry.getKey();
    final Object tagExpr=entry.getValue();
    if ("String_Node_Str".equals(tag)) {
      info.expr=(String)tagExpr;
    }
 else {
      if (info.args == null) {
        info.args=new HashMap<String,Object>();
      }
      info.args.put(tag,tagExpr);
    }
  }
  if (Strings.isBlank(info.expr)) {
    throw new UiException("String_Node_Str");
  }
  info.args=info.args == null ? null : parsedArgs(info.args);
  return info;
}

Fixed version (ground truth):
private ConverterInfo parseConverter(ComponentCtrl compCtrl,Annotation anno){
  ConverterInfo info=new ConverterInfo();
  for (final Iterator<Entry<String,Object>> it=anno.getAttributes().entrySet().iterator(); it.hasNext(); ) {
    final Entry<String,Object> entry=it.next();
    final String tag=(String)entry.getKey();
    final Object tagExpr=entry.getValue();
    if ("String_Node_Str".equals(tag)) {
      info.expr=(String)tagExpr;
    }
 else {
      if (info.args == null) {
        info.args=new HashMap<String,Object>();
      }
      info.args.put(tag,tagExpr);
    }
  }
  if (Strings.isBlank(info.expr)) {
    throw new UiException("String_Node_Str");
  }
  info.args=info.args == null ? null : parsedArgs(info.args);
  return info;
}
Program: 16433
Project: 16433
Buggy source:
public ExpressionX parseExpressionX(BindContext ctx,String expression,Class expectedType) throws XelException {
  return (ExpressionX)getExpressionFactory().parseExpression(newXelContext(ctx,null),"String_Node_Str" + expression + "String_Node_Str",expectedType);
}

Fixed version (ground truth):
public ExpressionX parseExpressionX(BindContext ctx,String expression,Class<?> expectedType) throws XelException {
  return (ExpressionX)getExpressionFactory().parseExpression(newXelContext(ctx,null),"String_Node_Str" + expression + "String_Node_Str",expectedType);
}
Program: 16434
Project: 16434
Buggy source:
private boolean doValidateSaveEvent(Component comp,SavePropertyBinding binding,Event evt,Set<Property> notifys){
  if (binding.hasValidator()) {
    final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,null,binding.getComponent(),evt);
    BindContextUtil.setConverterArgs(this,binding.getComponent(),ctx,binding);
    BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
    try {
      doBeforePhase(PhaseListener.VALIDATE,ctx);
      final Property p=binding.getValidate(ctx);
      log.debug("String_Node_Str",comp,binding,evt,p);
      if (p == null) {
        throw new UiException("String_Node_Str" + binding);
      }
      ValidationContext vctx=new ValidationContextImpl(null,p,toCollectedProperties(p),ctx,true);
      binding.validate(vctx);
      boolean valid=vctx.isValid();
      log.debug("String_Node_Str",valid);
      final Set<Property> xnotifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
      if (xnotifys != null) {
        notifys.addAll(xnotifys);
      }
      return valid;
    }
 catch (    Exception e) {
      throw UiException.Aide.wrap(e);
    }
 finally {
      doAfterPhase(PhaseListener.VALIDATE,ctx);
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean doValidateSaveEvent(Component comp,SavePropertyBinding binding,Event evt,Set<Property> notifys){
  if (binding.hasValidator()) {
    final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,null,binding.getComponent(),evt);
    BindContextUtil.setConverterArgs(this,binding.getComponent(),ctx,binding);
    BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
    try {
      doBeforePhase(PhaseListener.VALIDATE,ctx);
      final Property p=binding.getValidate(ctx);
      log.debug("String_Node_Str",comp,binding,evt,p);
      if (p == null) {
        throw new UiException("String_Node_Str" + binding);
      }
      ValidationContext vctx=new ValidationContextImpl(null,p,toCollectedProperties(p),ctx,true);
      binding.validate(vctx);
      boolean valid=vctx.isValid();
      log.debug("String_Node_Str",valid);
      final Set<Property> xnotifys=getNotifys(ctx);
      if (xnotifys != null) {
        notifys.addAll(xnotifys);
      }
      return valid;
    }
 catch (    Exception e) {
      throw UiException.Aide.wrap(e);
    }
 finally {
      doAfterPhase(PhaseListener.VALIDATE,ctx);
    }
  }
  return true;
}
Program: 16435
Project: 16435
Buggy source:
private void doSaveFormBinding(Component comp,SaveFormBinding binding,String command,Event evt,int phase,Set<Property> notifys){
  final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,command,binding.getComponent(),evt);
  BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
  try {
    log.debug("String_Node_Str",comp,binding,command,evt,notifys);
    doBeforePhase(phase,ctx);
    binding.save(ctx);
  }
  finally {
    doAfterPhase(phase,ctx);
  }
  final Set<Property> xnotifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
}

Fixed version (ground truth):
private void doSaveFormBinding(Component comp,SaveFormBinding binding,String command,Event evt,int phase,Set<Property> notifys){
  final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,command,binding.getComponent(),evt);
  BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
  try {
    log.debug("String_Node_Str",comp,binding,command,evt,notifys);
    doBeforePhase(phase,ctx);
    binding.save(ctx);
  }
  finally {
    doAfterPhase(phase,ctx);
  }
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
}
Program: 16436
Project: 16436
Buggy source:
private void doSavePropertyBinding(Component comp,SavePropertyBinding binding,String command,Event evt,int phase,Set<Property> notifys){
  final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,command,binding.getComponent(),evt);
  BindContextUtil.setConverterArgs(this,binding.getComponent(),ctx,binding);
  BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
  try {
    log.debug("String_Node_Str",comp,binding,command,evt,notifys);
    doBeforePhase(phase,ctx);
    binding.save(ctx);
  }
  finally {
    doAfterPhase(phase,ctx);
  }
  final Set<Property> xnotifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
}

Fixed version (ground truth):
private void doSavePropertyBinding(Component comp,SavePropertyBinding binding,String command,Event evt,int phase,Set<Property> notifys){
  final BindContext ctx=BindContextUtil.newBindContext(this,binding,true,command,binding.getComponent(),evt);
  BindContextUtil.setConverterArgs(this,binding.getComponent(),ctx,binding);
  BindContextUtil.setValidatorArgs(this,binding.getComponent(),ctx,binding);
  try {
    log.debug("String_Node_Str",comp,binding,command,evt,notifys);
    doBeforePhase(phase,ctx);
    binding.save(ctx);
  }
  finally {
    doAfterPhase(phase,ctx);
  }
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
}
Program: 16437
Project: 16437
Buggy source:
public void onEvent(Event event) throws Exception {
  Object[] data=(Object[])event.getData();
  String command=(String)data[0];
  Map<String,Object> args=(Map)data[1];
  sendCommand(command,args);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onEvent(Event event) throws Exception {
  Object[] data=(Object[])event.getData();
  String command=(String)data[0];
  Map<String,Object> args=(Map)data[1];
  sendCommand(command,args);
}
Program: 16438
Project: 16438
Buggy source:
protected Object setAttribute(BindContext ctx,Object key,Object value){
  Map<Object,Object> bindingBag=(Map<Object,Object>)ctx.getAttribute(this);
  if (bindingBag == null) {
    bindingBag=new HashMap<Object,Object>();
    ctx.setAttribute(this,bindingBag);
  }
  return bindingBag.put(key,value);
}

Fixed version (ground truth):
protected Object setAttribute(BindContext ctx,Object key,Object value){
  Map<Object,Object> bindingBag=getBindingAttribute(ctx);
  if (bindingBag == null) {
    bindingBag=new HashMap<Object,Object>();
    ctx.setAttribute(this,bindingBag);
  }
  return bindingBag.put(key,value);
}
Program: 16439
Project: 16439
Buggy source:
protected Object getAttribute(BindContext ctx,Object key){
  Map<Object,Object> bindingBag=(Map<Object,Object>)ctx.getAttribute(this);
  return bindingBag != null ? bindingBag.get(key) : null;
}

Fixed version (ground truth):
protected Object getAttribute(BindContext ctx,Object key){
  Map<Object,Object> bindingBag=getBindingAttribute(ctx);
  return bindingBag != null ? bindingBag.get(key) : null;
}
Program: 16440
Project: 16440
Buggy source:
protected boolean containsAttribute(BindContext ctx,Object key){
  Map<Object,Object> bindingBag=(Map<Object,Object>)ctx.getAttribute(this);
  return bindingBag != null ? bindingBag.containsKey(key) : false;
}

Fixed version (ground truth):
protected boolean containsAttribute(BindContext ctx,Object key){
  Map<Object,Object> bindingBag=getBindingAttribute(ctx);
  return bindingBag != null ? bindingBag.containsKey(key) : false;
}
Program: 16441
Project: 16441
Buggy source:
public Component getComponent(){
  Object comp=_comp == null ? null : ((WeakReference<Object>)_comp).get();
  if (comp == null && _comp != null) {
    _comp=null;
  }
  return (Component)comp;
}

Fixed version (ground truth):
public Component getComponent(){
  Object comp=_comp == null ? null : _comp.get();
  if (comp == null && _comp != null) {
    _comp=null;
  }
  return (Component)comp;
}
Program: 16442
Project: 16442
Buggy source:
private void addConverterDependsOnTrackings(Converter conv,BindContext ctx){
  final Class convClz=conv.getClass();
  if (_doneConverterDependsOn.contains(convClz)) {
    return;
  }
  _doneConverterDependsOn.add(convClz);
  final Method m=getConverterMethod(convClz);
  final String srcpath=getPropertyString();
  BindELContext.addDependsOnTrackings(m,srcpath,null,this,ctx);
}

Fixed version (ground truth):
private void addConverterDependsOnTrackings(Converter conv,BindContext ctx){
  final Class<? extends Converter> convClz=conv.getClass();
  if (_doneConverterDependsOn.contains(convClz)) {
    return;
  }
  _doneConverterDependsOn.add(convClz);
  final Method m=getConverterMethod(convClz);
  final String srcpath=getPropertyString();
  BindELContext.addDependsOnTrackings(m,srcpath,null,this,ctx);
}
Program: 16443
Project: 16443
Buggy source:
private boolean validateSaveFormBinding(Component comp,SaveFormBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  if (!binding.hasValidator())   return true;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return vContext.isValid();
}

Fixed version (ground truth):
private boolean validateSaveFormBinding(Component comp,SaveFormBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  if (!binding.hasValidator())   return true;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return vContext.isValid();
}
Program: 16444
Project: 16444
Buggy source:
private boolean validateSavePropertyBinding(Component comp,SavePropertyBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  if (!binding.hasValidator())   return true;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return vContext.isValid();
}

Fixed version (ground truth):
private boolean validateSavePropertyBinding(Component comp,SavePropertyBinding binding,String command,Map<String,Property[]> validates,boolean valid,Set<Property> notifys){
  if (!binding.hasValidator())   return true;
  final BindContext ctx=BindContextUtil.newBindContext(_binder,binding,true,command,binding.getComponent(),null);
  BindContextUtil.setValidatorArgs(binding.getBinder(),binding.getComponent(),ctx,binding);
  Property p=_mainPropertyCache.get(binding);
  ValidationContextImpl vContext=new ValidationContextImpl(command,p,validates,ctx,valid);
  binding.validate(vContext);
  final Set<Property> xnotifys=getNotifys(ctx);
  if (xnotifys != null) {
    notifys.addAll(xnotifys);
  }
  return vContext.isValid();
}
Program: 16445
Project: 16445
Buggy source:
public Collection<V> values(){
  if (this.values == null) {
    this.values=new AbstractCollection<V>(){
      public Iterator<V> iterator(){
        return createHashIterator(VALUES);
      }
      public int size(){
        return WeakIdentityMap.this.count;
      }
      public boolean contains(      Object o){
        return containsValue(o);
      }
      public void clear(){
        WeakIdentityMap.this.clear();
      }
      public String toString(){
        return WeakIdentityMap.this.toString(this);
      }
    }
;
  }
  return this.values;
}

Fixed version (ground truth):
public Collection<V> values(){
  if (this.values == null) {
    this.values=new AbstractCollection<V>(){
      public Iterator<V> iterator(){
        return createHashIterator(VALUES);
      }
      public int size(){
        return WeakIdentityMap.this.count;
      }
      public boolean contains(      Object o){
        return containsValue(o);
      }
      public void clear(){
        WeakIdentityMap.this.clear();
      }
      public String toString(){
        return WeakIdentityMap.toString(this);
      }
    }
;
  }
  return this.values;
}
Program: 16446
Project: 16446
Buggy source:
public Set<K> keySet(){
  if (this.keySet == null) {
    this.keySet=new AbstractSet<K>(){
      public Iterator iterator(){
        return createHashIterator(KEYS);
      }
      public int size(){
        return WeakIdentityMap.this.count;
      }
      public boolean contains(      Object o){
        return containsKey(o);
      }
      public boolean remove(      Object o){
        return o == null ? false : WeakIdentityMap.this.remove(o) == o;
      }
      public void clear(){
        WeakIdentityMap.this.clear();
      }
      public String toString(){
        return WeakIdentityMap.this.toString(this);
      }
    }
;
  }
  return this.keySet;
}

Fixed version (ground truth):
public Set<K> keySet(){
  if (this.keySet == null) {
    this.keySet=new AbstractSet<K>(){
      public Iterator iterator(){
        return createHashIterator(KEYS);
      }
      public int size(){
        return WeakIdentityMap.this.count;
      }
      public boolean contains(      Object o){
        return containsKey(o);
      }
      public boolean remove(      Object o){
        return o == null ? false : WeakIdentityMap.this.remove(o) == o;
      }
      public void clear(){
        WeakIdentityMap.this.clear();
      }
      public String toString(){
        return WeakIdentityMap.toString(this);
      }
    }
;
  }
  return this.keySet;
}
Program: 16447
Project: 16447
Buggy source:
private void dumpPropNameMapping(TrackerNode node,int spaces){
  if (((TrackerNodeImpl)node).getPropNameMapping().size() == 0)   return;
  System.out.println(dumpSpace(spaces) + "String_Node_Str");
  for (  Entry entry : ((TrackerNodeImpl)node).getPropNameMapping().entrySet()) {
    dumpEntry(entry,spaces + 4);
  }
  System.out.println(dumpSpace(spaces) + "String_Node_Str");
}

Fixed version (ground truth):
private void dumpPropNameMapping(TrackerNode node,int spaces){
  if (((TrackerNodeImpl)node).getPropNameMapping().size() == 0)   return;
  System.out.println(dumpSpace(spaces) + "String_Node_Str");
  for (  Entry<Object,Object> entry : ((TrackerNodeImpl)node).getPropNameMapping().entrySet()) {
    dumpEntry(entry,spaces + 4);
  }
  System.out.println(dumpSpace(spaces) + "String_Node_Str");
}
Program: 16448
Project: 16448
Buggy source:
private void dumpEntry(Entry entry,int spaces){
  System.out.println(dumpSpace(spaces) + entry.getKey() + "String_Node_Str"+ entry.getValue());
}

Fixed version (ground truth):
private void dumpEntry(Entry<Object,Object> entry,int spaces){
  System.out.println(dumpSpace(spaces) + entry.getKey() + "String_Node_Str"+ entry.getValue());
}
Program: 16449
Project: 16449
Buggy source:
private Set<TrackerNode> getNodes(Object base,String postfix){
  Set<TrackerNode> nodes=getTrackerNodesByBean(base);
  String[] props=postfix.split("String_Node_Str");
  for (  String prop : props) {
    nodes=getDependents(nodes,prop);
  }
  return nodes;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Set<TrackerNode> getNodes(Object base,String postfix){
  Set<TrackerNode> nodes=getTrackerNodesByBean(base);
  String[] props=postfix.split("String_Node_Str");
  for (  String prop : props) {
    nodes=getDependents(nodes,prop);
  }
  return nodes;
}
Program: 16450
Project: 16450
Buggy source:
public Object getBean(){
  Object bean=_bean == null ? null : ((WeakReference<Object>)_bean).get();
  if (bean == null && _bean != null) {
    setBean(null);
  }
  return bean;
}

Fixed version (ground truth):
public Object getBean(){
  Object bean=_bean == null ? null : _bean.get();
  if (bean == null && _bean != null) {
    setBean(null);
  }
  return bean;
}
Program: 16451
Project: 16451
Buggy source:
public Expression parseExpression(XelContext xelc,String expression,Class expectedType) throws XelException {
  return new BindXelExpression(_expf.createValueExpression(newELContext(xelc),expression,expectedType));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Expression parseExpression(XelContext xelc,String expression,Class expectedType) throws XelException {
  return new BindXelExpression(_expf.createValueExpression(newELContext(xelc),expression,expectedType));
}
Program: 16452
Project: 16452
Buggy source:
private static void addNotifys(Set<Property> props,BindContext ctx){
  if (ctx == null) {
    return;
  }
  Set<Property> notifys=(Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
  if (notifys == null) {
    notifys=new LinkedHashSet<Property>();
    ctx.setAttribute(BinderImpl.NOTIFYS,notifys);
  }
  notifys.addAll(props);
}

Fixed version (ground truth):
private static void addNotifys(Set<Property> props,BindContext ctx){
  if (ctx == null) {
    return;
  }
  Set<Property> notifys=getNotifys(ctx);
  if (notifys == null) {
    notifys=new LinkedHashSet<Property>();
    ctx.setAttribute(BinderImpl.NOTIFYS,notifys);
  }
  notifys.addAll(props);
}
Program: 16453
Project: 16453
Buggy source:
public static Set<Property> getNotifys(Method m,Object base,String prop,Object value){
  final Set<Property> notifys=new LinkedHashSet<Property>();
  final NotifyChange annt=m == null ? null : m.getAnnotation(NotifyChange.class);
  if (annt != null) {
    String[] notifies=annt.value();
    if (notifies.length > 0) {
      for (      String notify : notifies) {
        final Property propx=new PropertyImpl(base,notify,value);
        notifys.add(propx);
      }
    }
 else     if (prop != null) {
      notifys.add(new PropertyImpl(base,prop,value));
    }
  }
  return notifys;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static Set<Property> getNotifys(BindContext ctx){
  return (Set<Property>)ctx.getAttribute(BinderImpl.NOTIFYS);
}
Program: 16454
Project: 16454
Buggy source:
private static void addValidates(Set<Property> props,BindContext ctx){
  if (ctx == null) {
    return;
  }
  Set<Property> validates=(Set<Property>)ctx.getAttribute(BinderImpl.VALIDATES);
  if (validates == null) {
    validates=new LinkedHashSet<Property>();
    ctx.setAttribute(BinderImpl.VALIDATES,validates);
  }
  validates.addAll(props);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static void addValidates(Set<Property> props,BindContext ctx){
  if (ctx == null) {
    return;
  }
  Set<Property> validates=getValidates(ctx);
  if (validates == null) {
    validates=new LinkedHashSet<Property>();
    ctx.setAttribute(BinderImpl.VALIDATES,validates);
  }
  validates.addAll(props);
}
Program: 16456
Project: 16456
Buggy source:
/** 
 * Adds child to this node at the given index.
 * @exception IndexOutOfBoundsException	if <code>index</code> is out of bounds
 * @exception IllegalArgumentException if <code>child</code> is an ancestor of this node 
 * @exception IllegalStateException if this node does not allow children
 * @exception NullPointerException if <code>child</code> is null
 */
public void insert(TreeNode child,int index){
  if (isLeaf())   throw new UnsupportedOperationException("String_Node_Str");
  _children.add(index,child);
}

Fixed version (ground truth):
/** 
 * Adds child to this node at the given index.
 * @exception IndexOutOfBoundsException	if <code>index</code> is out of bounds
 * @exception IllegalArgumentException if <code>child</code> is an ancestor of this node 
 * @exception UnsupportedOperationException if this node does not allow children
 * @exception NullPointerException if <code>child</code> is null
 */
public void insert(TreeNode child,int index){
  if (isLeaf())   throw new UnsupportedOperationException("String_Node_Str");
  _children.add(index,child);
}
Program: 16457
Project: 16457
Buggy source:
/** 
 * Return children of the receiver
 * @return children of the receiver
 */
public List getChildren();

Fixed version (ground truth):
/** 
 * Return children of the receiver
 * @return children of the receiver. If the node is a leaf, null is returned.
 */
public List getChildren();
Program: 16458
Project: 16458
Buggy source:
/** 
 * Creates a leaf node, i.e., it won't allow any children.
 * @param nullAsMax whether to consider null as the maximum value.If false, null is considered as the minimum value.
 */
public DefaultTreeNode(Object data,boolean nullAsMax){
  _data=data;
  _leaf=true;
  _children=null;
  _maxnull=nullAsMax;
}

Fixed version (ground truth):
/** 
 * Creates a leaf node, i.e., it won't allow any children.
 * @param nullAsMax whether to consider null as the maximum value.If false, null is considered as the minimum value.
 */
public DefaultTreeNode(Object data,boolean nullAsMax){
  _data=data;
  _children=null;
  _maxnull=nullAsMax;
}
Program: 16459
Project: 16459
Buggy source:
public boolean isLeaf(){
  return _leaf;
}

Fixed version (ground truth):
public boolean isLeaf(){
  return _children == null;
}
Program: 16460
Project: 16460
Buggy source:
/** 
 * Adds child to this node at the given index.
 * @exception IndexOutOfBoundsException	if <code>index</code> is out of bounds
 * @exception IllegalArgumentException if <code>child</code> is an ancestor of this node 
 * @exception UnsupportedOperationException if this node does not allow children
 * @exception NullPointerException if <code>child</code> is null
 */
public void insert(TreeNode child,int index){
  if (isLeaf())   throw new UnsupportedOperationException("String_Node_Str");
  _children.add(index,child);
}

Fixed version (ground truth):
public void insert(TreeNode child,int index){
  if (isLeaf())   throw new UnsupportedOperationException("String_Node_Str");
  _children.add(index,child);
}
Program: 16461
Project: 16461
Buggy source:
/** 
 * Adds a child to this node at the end.
 * @exception UnsupportedOperationException if the tree structure is not mutable
 */
public void add(TreeNode child);

Fixed version (ground truth):
/** 
 * Adds a child to this node at the end.
 * @exception UnsupportedOperationException if the tree structure is not mutable,or this node does not allow children
 * @exception IllegalArgumentException if <code>child</code> is an ancestor of this node 
 * @exception NullPointerException if <code>child</code> is null
 */
public void add(TreeNode child);
Program: 16462
Project: 16462
Buggy source:
/** 
 * Adds child to this node at the given index.
 * @exception UnsupportedOperationException if the tree structure is not mutable
 */
public void insert(TreeNode child,int index);

Fixed version (ground truth):
/** 
 * Adds child to this node at the given index.
 * @exception UnsupportedOperationException if the tree structure is not mutable,or this node does not allow children
 * @exception IndexOutOfBoundsException	if <code>index</code> is out of bounds
 * @exception IllegalArgumentException if <code>child</code> is an ancestor of this node 
 * @exception NullPointerException if <code>child</code> is null
 */
public void insert(TreeNode child,int index);
Program: 16463
Project: 16463
Buggy source:
/** 
 * Removes the child from this node.
 * @exception UnsupportedOperationException if the tree structure is not mutable
 */
public void remove(TreeNode child);

Fixed version (ground truth):
/** 
 * Removes the child from this node.
 * @exception UnsupportedOperationException if the tree structure is not mutableor this node does not allow children
 * @exception IllegalArgumentException if <code>child</code> is not a child of this node
 */
public void remove(TreeNode child);
Program: 16464
Project: 16464
Buggy source:
/** 
 * Creates a leaf node, i.e., it won't allow any children.
 * @param nullAsMax whether to consider null as the maximum value.If false, null is considered as the minimum value.
 */
public DefaultTreeNode(Object data,boolean nullAsMax){
  _data=data;
  _leaf=true;
  _maxnull=nullAsMax;
}

Fixed version (ground truth):
/** 
 * Creates a leaf node, i.e., it won't allow any children.
 * @param nullAsMax whether to consider null as the maximum value.If false, null is considered as the minimum value.
 */
public DefaultTreeNode(Object data,boolean nullAsMax){
  _data=data;
  _leaf=true;
  _children=null;
  _maxnull=nullAsMax;
}
Program: 16465
Project: 16465
Buggy source:
public Object remove(TreeNode child){
  int index=_list.indexOf(child);
  if (index < 0)   throw new IllegalArgumentException("String_Node_Str");
  return _list.remove(index);
}

Fixed version (ground truth):
public Object remove(TreeNode child){
  int index=_list.indexOf(child);
  if (index < 0)   throw new IllegalArgumentException("String_Node_Str");
  return remove(index);
}
Program: 16466
Project: 16466
Buggy source:
public Object remove(TreeNode child){
  int index=_list.indexOf(child);
  if (index < 0)   throw new IllegalArgumentException("String_Node_Str");
  return remove(index);
}

Fixed version (ground truth):
public boolean remove(Object child){
  int index=_list.indexOf(child);
  if (index < 0)   return false;
  remove(index);
  return true;
}