nus-yam/ex-repair huggingface dataset:
Program: 117437
Project: 117437
Buggy source:
public TabsPanel(String id,IModel<T> model,IModel<? extends List<? extends T>> tabsModel){
  super(id,model);
  setOutputMarkupPlaceholderTag(true);
  tabs=new ListView<T>("String_Node_Str",tabsModel){
    @Override protected void populateItem(    final ListItem<T> item){
      item.add(new AttributeAppender("String_Node_Str","String_Node_Str"){
        @Override public boolean isEnabled(        Component component){
          return super.isEnabled(component) && Objects.equals(item.getModelObject(),TabsPanel.this.getModelObject());
        }
      }
);
      item.add(new AjaxLink<T>("String_Node_Str",item.getModel()){
        @Override public void onClick(        AjaxRequestTarget target){
          TabsPanel.this.setModelObject(item.getModelObject());
          onTabClick(target);
          target.add(TabsPanel.this);
        }
      }
.setBody(newTabNameModel(item.getModel())));
    }
  }
;
  add(tabs);
}

Fixed version (ground truth):
public TabsPanel(String id,IModel<T> model,IModel<? extends List<? extends T>> tabsModel){
  super(id,model);
  setOutputMarkupPlaceholderTag(true);
  tabs=new ListView<T>("String_Node_Str",tabsModel){
    @Override protected void populateItem(    final ListItem<T> item){
      item.add(new AttributeAppender("String_Node_Str","String_Node_Str"){
        @Override public boolean isEnabled(        Component component){
          return super.isEnabled(component) && Objects.equals(item.getModelObject(),TabsPanel.this.getModelObject());
        }
      }
);
      item.add(new AjaxLink<T>("String_Node_Str",item.getModel()){
        @Override public void onClick(        AjaxRequestTarget target){
          TabsPanel.this.setModelObject(item.getModelObject());
          onTabClick(target);
          target.add(TabsPanel.this);
        }
      }
.setBody(newTabNameModel(item.getModel())));
    }
    @Override protected void onConfigure(){
      T tab=TabsPanel.this.getModelObject();
      if (!getModelObject().contains(tab)) {
        T defaultTab=getDefaultTab();
        if (defaultTab != null && getModelObject().contains(defaultTab)) {
          tab=defaultTab;
        }
 else {
          List<T> tabs=getModelObject();
          tab=tabs != null && tabs.size() > 0 ? tabs.get(0) : null;
        }
        TabsPanel.this.setModelObject(tab);
      }
      super.onConfigure();
    }
  }
;
  add(tabs);
}
Program: 117438
Project: 117438
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  if (DisplayMode.EDIT.equals(displayMode.getObject())) {
    saveODocumentCommand.configure();
    if (!saveODocumentCommand.determineVisibility()) {
      displayMode.setObject(DisplayMode.VIEW);
    }
  }
  if (tabModel.getObject() == null)   tabModel.setObject(CustomAttributes.TAB.<String>getValue(getDocument().getSchemaClass(),IOClassIntrospector.DEFAULT_TAB));
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  if (DisplayMode.EDIT.equals(displayMode.getObject())) {
    saveODocumentCommand.configure();
    if (!saveODocumentCommand.determineVisibility()) {
      displayMode.setObject(DisplayMode.VIEW);
    }
  }
}
Program: 117439
Project: 117439
Buggy source:
public DocumentPage(PageParameters parameters){
  super(parameters);
  DisplayMode mode=DisplayMode.parse(parameters.get("String_Node_Str").toOptionalString());
  if (mode != null)   displayMode.setObject(mode);
}

Fixed version (ground truth):
public DocumentPage(PageParameters parameters){
  super(parameters);
  DisplayMode mode=DisplayMode.parse(parameters.get("String_Node_Str").toOptionalString());
  if (mode != null)   displayMode.setObject(mode);
  String tab=parameters.get("String_Node_Str").toOptionalString();
  tabModel.setObject(tab);
}
Program: 117440
Project: 117440
Buggy source:
@Override protected void onInitialize(){
  super.onInitialize();
  propertiesStructureTable.addCommand(new EditODocumentCommand(propertiesStructureTable,displayMode));
  propertiesStructureTable.addCommand(saveODocumentCommand=new SaveODocumentCommand(propertiesStructureTable,displayMode));
}

Fixed version (ground truth):
@Override protected void onInitialize(){
  super.onInitialize();
  String defaultTab=CustomAttributes.TAB.<String>getValue(getDocument().getSchemaClass(),IOClassIntrospector.DEFAULT_TAB);
  tabsPanel.setDefaultTabModel(Model.of(defaultTab));
  propertiesStructureTable.addCommand(new EditODocumentCommand(propertiesStructureTable,displayMode));
  propertiesStructureTable.addCommand(saveODocumentCommand=new SaveODocumentCommand(propertiesStructureTable,displayMode));
}
Program: 117442
Project: 117442
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  if (DisplayMode.EDIT.equals(displayMode.getObject())) {
    saveODocumentCommand.configure();
    if (!saveODocumentCommand.determineVisibility()) {
      displayMode.setObject(DisplayMode.VIEW);
    }
  }
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  if (DisplayMode.EDIT.equals(displayMode.getObject())) {
    saveODocumentCommand.configure();
    if (!saveODocumentCommand.determineVisibility()) {
      displayMode.setObject(DisplayMode.VIEW);
    }
  }
  if (tabModel.getObject() == null)   tabModel.setObject(CustomAttributes.TAB.<String>getValue(getDocument().getSchemaClass(),IOClassIntrospector.DEFAULT_TAB));
}
Program: 117444
Project: 117444
Buggy source:
@Override protected void convertInput(){
  M converted;
  List<T> storedData=getData();
  if (finalType.isInstance(storedData))   converted=(M)storedData;
 else {
    try {
      converted=(M)finalType.newInstance();
      converted.addAll(storedData);
    }
 catch (    InstantiationException e) {
      throw new WicketRuntimeException("String_Node_Str" + finalType.getName(),e);
    }
catch (    IllegalAccessException e) {
      throw new WicketRuntimeException("String_Node_Str" + finalType.getName(),e);
    }
  }
  setConvertedInput(converted);
}

Fixed version (ground truth):
@Override protected void convertInput(){
  M converted;
  List<T> storedData=getData();
  visitFormComponentsPostOrder(this,new IVisitor<FormComponent<Object>,Void>(){
    @Override public void component(    FormComponent<Object> object,    IVisit<Void> visit){
      if (!(EmbeddedCollectionEditPanel.this.equals(object))) {
        object.updateModel();
        visit.dontGoDeeper();
      }
    }
  }
);
  if (finalType.isInstance(storedData))   converted=(M)storedData;
 else {
    try {
      converted=(M)finalType.newInstance();
      converted.addAll(storedData);
    }
 catch (    InstantiationException e) {
      throw new WicketRuntimeException("String_Node_Str" + finalType.getName(),e);
    }
catch (    IllegalAccessException e) {
      throw new WicketRuntimeException("String_Node_Str" + finalType.getName(),e);
    }
  }
  setConvertedInput(converted);
}
Program: 117447
Project: 117447
Buggy source:
public LinksCollectionViewPanel(String id,IModel<ODocument> documentModel,OProperty property){
  super(id,new DynamicPropertyValueModel<M>(documentModel,new OPropertyModel(property)));
  OQueryDataProvider<ODocument> provider=oClassIntrospector.prepareDataProviderForProperty(property,documentModel);
  List<IColumn<ODocument,String>> columns=new ArrayList<IColumn<ODocument,String>>();
  columns.add(new OEntityColumn(property.getLinkedClass(),DisplayMode.VIEW.asModel()));
  OrienteerDataTable<ODocument,String> table=new OrienteerDataTable<ODocument,String>("String_Node_Str",columns,provider,10);
  table.getHeadersToolbar().setVisibilityAllowed(false);
  table.getNoRecordsToolbar().setVisibilityAllowed(false);
  add(table);
}

Fixed version (ground truth):
public LinksCollectionViewPanel(String id,IModel<ODocument> documentModel,OProperty property){
  super(id,new DynamicPropertyValueModel<M>(documentModel,new OPropertyModel(property)));
  ISortableDataProvider<ODocument,String> provider=oClassIntrospector.prepareDataProviderForProperty(property,documentModel);
  List<IColumn<ODocument,String>> columns=new ArrayList<IColumn<ODocument,String>>();
  columns.add(new OEntityColumn(property.getLinkedClass(),DisplayMode.VIEW.asModel()));
  OrienteerDataTable<ODocument,String> table=new OrienteerDataTable<ODocument,String>("String_Node_Str",columns,provider,10);
  table.getHeadersToolbar().setVisibilityAllowed(false);
  table.getNoRecordsToolbar().setVisibilityAllowed(false);
  add(table);
}
Program: 117449
Project: 117449
Buggy source:
public OQueryDataProvider<ODocument> prepareDataProviderForProperty(OProperty property,IModel<ODocument> documentModel);

Fixed version (ground truth):
public ISortableDataProvider<ODocument,String> prepareDataProviderForProperty(OProperty property,IModel<ODocument> documentModel);
Program: 117450
Project: 117450
Buggy source:
@Override public OQueryDataProvider<ODocument> prepareDataProviderForProperty(OProperty property,IModel<ODocument> documentModel){
  String sql;
  if (CustomAttributes.CALCULABLE.getValue(property,false)) {
    sql=CustomAttributes.CALC_SCRIPT.getValue(property);
    sql=sql.replace("String_Node_Str","String_Node_Str");
  }
 else {
    sql="String_Node_Str" + property.getName() + "String_Node_Str"+ property.getOwnerClass().getName()+ "String_Node_Str";
  }
  OQueryDataProvider<ODocument> provider=new OQueryDataProvider<ODocument>(sql);
  provider.setParameter("String_Node_Str",documentModel);
  return provider;
}

Fixed version (ground truth):
@Override public ISortableDataProvider<ODocument,String> prepareDataProviderForProperty(OProperty property,IModel<ODocument> documentModel){
  if (CustomAttributes.CALCULABLE.getValue(property,false)) {
    String sql=CustomAttributes.CALC_SCRIPT.getValue(property);
    sql=sql.replace("String_Node_Str","String_Node_Str");
    OQueryDataProvider<ODocument> provider=new OQueryDataProvider<ODocument>(sql);
    provider.setParameter("String_Node_Str",documentModel);
    return provider;
  }
 else {
    return new ODocumentLinksDataProvider(documentModel,property);
  }
}
Program: 117451
Project: 117451
Buggy source:
public LoginPage(){
  super();
  add(new SignInPanel("String_Node_Str",false));
}

Fixed version (ground truth):
public LoginPage(){
  super();
  SignInPanel signInPanel=new SignInPanel("String_Node_Str",true);
  signInPanel.setRememberMe(false);
  add(signInPanel);
}
Program: 117452
Project: 117452
Buggy source:
public LogoutPage(){
  OrientDbWebSession session=OrientDbWebSession.get();
  if (session.isSignedIn()) {
    session.signOut();
  }
  setResponsePage(OrienteerWebApplication.get().getHomePage());
}

Fixed version (ground truth):
public LogoutPage(){
  OrientDbWebSession.get().invalidate();
  setResponsePage(OrienteerWebApplication.get().getHomePage());
}
Program: 117455
Project: 117455
Buggy source:
@Override public void onClick(){
  setResponsePage(new OPropertyPage(new OPropertyModel(OPropertyPrototyper.newPrototype(classModel.getObject().getName()))).setDisplayMode(DisplayMode.EDIT));
}

Fixed version (ground truth):
@Override public void onClick(){
  OClass oClass=classModel.getObject();
  OProperty newProperty=OPropertyPrototyper.newPrototype(oClass.getName());
  CustomAttributes.ORDER.setValue(newProperty,findMaxOrder(oClass) + 10);
  setResponsePage(new OPropertyPage(new OPropertyModel(newProperty)).setDisplayMode(DisplayMode.EDIT));
}
Program: 117456
Project: 117456
Buggy source:
public OClassMetaColumn(String sortProperty,IModel<String> criteryModel){
  super(sortProperty,criteryModel);
}

Fixed version (ground truth):
public OClassMetaColumn(String sortParam,String critery){
  super(sortParam,Model.of(critery));
}
Program: 117457
Project: 117457
Buggy source:
public OIndexMetaColumn(String sortProperty,IModel<String> criteryModel){
  super(sortProperty,criteryModel);
}

Fixed version (ground truth):
public OIndexMetaColumn(String sortParam,String critery){
  super(sortParam,Model.of(critery));
}
Program: 117458
Project: 117458
Buggy source:
public OPropertyMetaColumn(String sortProperty,IModel<String> criteryModel){
  super(sortProperty,criteryModel);
}

Fixed version (ground truth):
public OPropertyMetaColumn(String sortParam,String critery){
  super(sortParam,Model.of(critery));
}
Program: 117459
Project: 117459
Buggy source:
public OrienteerDataTable(String id,List<? extends IColumn<T,S>> columns,ISortableDataProvider<T,S> dataProvider,int rowsPerPage){
  super(id,columns,dataProvider,rowsPerPage);
  addTopToolbar(commandsToolbar=new DataTableCommandsToolbar<T>(this));
  addTopToolbar(headersToolbar=new HeadersToolbar<S>(this,dataProvider));
  addBottomToolbar(new NavigationToolbar(this));
  addBottomToolbar(noRecordsToolbar=new NoRecordsToolbar(this));
  setOutputMarkupPlaceholderTag(true);
}

Fixed version (ground truth):
public OrienteerDataTable(String id,List<? extends IColumn<T,S>> columns,ISortableDataProvider<T,S> dataProvider,int rowsPerPage){
  super(id,columns,dataProvider,rowsPerPage);
  addTopToolbar(commandsToolbar=new DataTableCommandsToolbar<T>(this));
  addTopToolbar(headersToolbar=new AjaxFallbackHeadersToolbar<S>(this,dataProvider));
  addBottomToolbar(navigationToolbar=new AjaxNavigationToolbar(this));
  addBottomToolbar(noRecordsToolbar=new NoRecordsToolbar(this));
  setOutputMarkupPlaceholderTag(true);
}
Program: 117462
Project: 117462
Buggy source:
public SelectDialogPanel(String id,final ModalWindow modal,IModel<OClass> oClassModel){
  super(id,Model.of("String_Node_Str"));
  this.modal=modal;
  canChangeClass=oClassModel == null;
  this.selectedClassModel=canChangeClass ? new OClassModel(getClasses().get(0)) : oClassModel;
  Form<String> form=new Form<String>("String_Node_Str",getModel());
  form.add(new TextField<String>("String_Node_Str",getModel()));
  form.add(new AjaxButton("String_Node_Str"){
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      super.onSubmit(target,form);
      target.add(resultsContainer);
    }
  }
);
  form.add(new TabsPanel<OClass>("String_Node_Str",selectedClassModel,new PropertyModel<List<OClass>>(this,"String_Node_Str")){
    @Override public void onTabClick(    AjaxRequestTarget target){
      prepareResults();
      target.add(resultsContainer);
    }
  }
.setVisible(canChangeClass));
  resultsContainer=new WebMarkupContainer("String_Node_Str"){
{
      setOutputMarkupPlaceholderTag(true);
    }
    @Override protected void onConfigure(){
      super.onConfigure();
      setVisible(!Strings.isEmpty(SelectDialogPanel.this.getModelObject()));
    }
  }
;
  prepareResults();
  form.add(resultsContainer);
  add(form);
}

Fixed version (ground truth):
public SelectDialogPanel(String id,final ModalWindow modal,OClass initialClass,boolean canChangeClass){
  super(id,Model.of("String_Node_Str"));
  this.modal=modal;
  this.canChangeClass=canChangeClass || initialClass == null;
  this.selectedClassModel=new OClassModel(initialClass != null ? initialClass : getClasses().get(0));
  Form<String> form=new Form<String>("String_Node_Str",getModel());
  form.add(new TextField<String>("String_Node_Str",getModel()));
  form.add(new AjaxButton("String_Node_Str"){
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      super.onSubmit(target,form);
      target.add(resultsContainer);
    }
  }
);
  form.add(new TabsPanel<OClass>("String_Node_Str",selectedClassModel,new PropertyModel<List<OClass>>(this,"String_Node_Str")){
    @Override public void onTabClick(    AjaxRequestTarget target){
      prepareResults();
      target.add(resultsContainer);
    }
  }
.setVisible(canChangeClass));
  resultsContainer=new WebMarkupContainer("String_Node_Str"){
{
      setOutputMarkupPlaceholderTag(true);
    }
    @Override protected void onConfigure(){
      super.onConfigure();
      setVisible(!Strings.isEmpty(SelectDialogPanel.this.getModelObject()));
    }
  }
;
  prepareResults();
  form.add(resultsContainer);
  add(form);
}
Program: 117463
Project: 117463
Buggy source:
public Command(String commandId,IModel<?> labelModel){
  super(commandId);
  link=newLink("String_Node_Str");
  link.setOutputMarkupId(true);
  link.add(new AttributeAppender("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str"),"String_Node_Str"));
  link.add(new AttributeAppender("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str"),"String_Node_Str"));
  link.add(new Label("String_Node_Str",labelModel).setRenderBodyOnly(true));
  link.add(new FAIcon("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str")));
  add(link);
}

Fixed version (ground truth):
public Command(String commandId,IModel<?> labelModel){
  super(commandId);
  link=newLink("String_Node_Str");
  link.setOutputMarkupId(true);
  link.add(new AttributeAppender("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str"),"String_Node_Str"));
  link.add(new AttributeAppender("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str"),"String_Node_Str"));
  link.add(new Label("String_Node_Str",labelModel).setRenderBodyOnly(true));
  link.add(new FAIcon("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str")));
  link.add(DISABLED_LINK_BEHAVIOR);
  add(link);
}
Program: 117464
Project: 117464
Buggy source:
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    ((AjaxRequestTarget)event.getPayload()).add(this);
    event.stop();
  }
}

Fixed version (ground truth):
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    AjaxRequestTarget target=((AjaxRequestTarget)event.getPayload());
    target.add(this);
    onAjaxUpdate(target);
    event.stop();
  }
}
Program: 117466
Project: 117466
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  if (getModelObject() == null)   throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND);
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  if (getModelObject() == null)   throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_NOT_FOUND);
  boolean isExistingClass=!(getModelObject() instanceof IPrototype);
  pTable.setEnabled(isExistingClass);
  iTable.setEnabled(isExistingClass);
  sTable.setEnabled(isExistingClass);
}
Program: 117467
Project: 117467
Buggy source:
public static String resolveNameProperty(OClass oClass){
  if (oClass == null)   return null;
  String ret=SchemaHelper.getCustomAttr(oClass,CustomAttributes.PROP_NAME);
  if (ret == null || !oClass.existsProperty(ret)) {
    if (oClass.existsProperty("String_Node_Str")) {
      ret="String_Node_Str";
    }
 else {
      for (      OProperty p : oClass.properties()) {
        if (OType.STRING.equals(p.getType())) {
          ret=p.getName();
          break;
        }
 else         if (!p.getType().isMultiValue()) {
          ret=p.getName();
        }
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
public static String resolveNameProperty(OClass oClass){
  if (oClass == null)   return null;
  OProperty property=CustomAttributes.PROP_NAME.getValue(oClass);
  String ret=property != null ? property.getName() : null;
  if (ret == null || oClass.getProperty(ret) == null) {
    if (oClass.getProperty("String_Node_Str") != null) {
      ret="String_Node_Str";
    }
 else {
      for (      OProperty p : oClass.properties()) {
        if (OType.STRING.equals(p.getType())) {
          ret=p.getName();
          break;
        }
 else         if (!p.getType().isMultiValue()) {
          ret=p.getName();
        }
      }
    }
  }
  return ret;
}
Program: 117468
Project: 117468
Buggy source:
@Override protected String execute(ODatabaseRecord db){
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>("String_Node_Str" + OCLASS_LOCALIZATION + "String_Node_Str"+ OPROPERTY_KEY+ "String_Node_Str");
  List<ODocument> result=db.command(query).execute(key);
  if (result == null || result.isEmpty()) {
    registerStringResourceRequest(key,language,style,variation);
    return null;
  }
  ODocument bestCandidate=null;
  int bestCandidateScore=-1;
  boolean fullMatchPresent=false;
  for (  ODocument candidate : result) {
    int score=0;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_LANG)))     score|=1 << 3;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_STYLE)))     score|=1 << 2;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_VARIATION)))     score|=1;
    if (score == 7)     fullMatchPresent=true;
    Boolean active=candidate.field(OPROPERTY_ACTIVE);
    if (active == null || active)     score=-1;
    if (score > bestCandidateScore) {
      bestCandidate=candidate;
      bestCandidateScore=score;
    }
  }
  if (!fullMatchPresent) {
    registerStringResourceRequest(key,language,style,variation);
  }
  return bestCandidate != null ? (String)bestCandidate.field(OPROPERTY_VALUE) : null;
}

Fixed version (ground truth):
@Override protected String execute(ODatabaseRecord db){
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>("String_Node_Str" + OCLASS_LOCALIZATION + "String_Node_Str"+ OPROPERTY_KEY+ "String_Node_Str");
  List<ODocument> result=db.command(query).execute(key);
  if (result == null || result.isEmpty()) {
    registerStringResourceRequest(key,language,style,variation);
    return null;
  }
  ODocument bestCandidate=null;
  int bestCandidateScore=-1;
  boolean fullMatchPresent=false;
  for (  ODocument candidate : result) {
    int score=0;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_LANG)))     score|=1 << 2;
    if (Strings.isEqual(style,(String)candidate.field(OPROPERTY_STYLE)))     score|=1 << 1;
    if (Strings.isEqual(variation,(String)candidate.field(OPROPERTY_VARIATION)))     score|=1;
    if (score == 7)     fullMatchPresent=true;
    Boolean active=candidate.field(OPROPERTY_ACTIVE);
    if (active == null || active)     score=-1;
    if (score > bestCandidateScore) {
      bestCandidate=candidate;
      bestCandidateScore=score;
    }
  }
  if (!fullMatchPresent) {
    registerStringResourceRequest(key,language,style,variation);
  }
  return bestCandidate != null ? (String)bestCandidate.field(OPROPERTY_VALUE) : null;
}
Program: 117470
Project: 117470
Buggy source:
@Override public void onSubmit(AjaxRequestTarget target,Form<?> form){
  performMultiAction(checkboxColumn.getSelected());
  checkboxColumn.resetSelection();
  this.send(this,Broadcast.BUBBLE,target);
}

Fixed version (ground truth):
@Override public void onSubmit(AjaxRequestTarget target,Form<?> form){
  performMultiAction(target,checkboxColumn.getSelected());
  checkboxColumn.resetSelection();
  this.send(this,Broadcast.BUBBLE,target);
}
Program: 117471
Project: 117471
Buggy source:
protected void performMultiAction(List<T> objects){
  for (  T object : objects) {
    perfromSingleAction(object);
  }
}

Fixed version (ground truth):
protected void performMultiAction(AjaxRequestTarget target,List<T> objects){
  for (  T object : objects) {
    perfromSingleAction(target,object);
  }
}
Program: 117472
Project: 117472
Buggy source:
protected void perfromSingleAction(T object){
}

Fixed version (ground truth):
protected void perfromSingleAction(AjaxRequestTarget target,T object){
}
Program: 117473
Project: 117473
Buggy source:
public Command(String commandId,IModel<?> labelModel){
  super(commandId);
  initialize(commandId,labelModel);
}

Fixed version (ground truth):
public Command(String commandId,IModel<?> labelModel){
  super(commandId);
  link=newLink("String_Node_Str");
  link.setOutputMarkupId(true);
  link.add(new AttributeAppender("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str"),"String_Node_Str"));
  link.add(new Label("String_Node_Str",labelModel).setRenderBodyOnly(true));
  link.add(new FAIcon("String_Node_Str",new PropertyModel<String>(this,"String_Node_Str")));
  add(link);
}
Program: 117474
Project: 117474
Buggy source:
@Override protected void performMultiAction(List<OProperty> objects){
  if (objects == null || objects.size() == 0) {
    error(OrienteerWebApplication.get().getResourceSettings().getLocalizer().getString("String_Node_Str",this));
    return;
  }
 else {
    List<String> fields=Lists.newArrayList(Lists.transform(objects,new Function<OProperty,String>(){
      @Override public String apply(      OProperty input){
        return input.getName();
      }
    }
));
    OClass oClass=classModel != null ? classModel.getObject() : null;
    if (oClass == null)     oClass=objects.get(0).getOwnerClass();
    setResponsePage(new OIndexPage(new OIndexModel(OIndexPrototyper.newPrototype(oClass.getName(),fields))).setDisplayMode(DisplayMode.EDIT));
  }
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<OProperty> objects){
  if (objects == null || objects.size() == 0) {
    error(OrienteerWebApplication.get().getResourceSettings().getLocalizer().getString("String_Node_Str",this));
    return;
  }
 else {
    List<String> fields=Lists.newArrayList(Lists.transform(objects,new Function<OProperty,String>(){
      @Override public String apply(      OProperty input){
        return input.getName();
      }
    }
));
    OClass oClass=classModel != null ? classModel.getObject() : null;
    if (oClass == null)     oClass=objects.get(0).getOwnerClass();
    setResponsePage(new OIndexPage(new OIndexModel(OIndexPrototyper.newPrototype(oClass.getName(),fields))).setDisplayMode(DisplayMode.EDIT));
  }
}
Program: 117475
Project: 117475
Buggy source:
@Override protected void performMultiAction(List<OClass> objects){
  getDatabase().commit();
  super.performMultiAction(objects);
  getDatabase().begin();
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<OClass> objects){
  getDatabase().commit();
  super.performMultiAction(target,objects);
  getDatabase().begin();
}
Program: 117476
Project: 117476
Buggy source:
@Override protected void perfromSingleAction(OClass object){
  getSchema().dropClass(object.getName());
}

Fixed version (ground truth):
@Override protected void perfromSingleAction(AjaxRequestTarget target,OClass object){
  getSchema().dropClass(object.getName());
}
Program: 117477
Project: 117477
Buggy source:
@Override protected void performMultiAction(List<ODocument> objects){
  super.performMultiAction(objects);
  getDatabase().commit(true);
  getDatabase().begin();
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<ODocument> objects){
  super.performMultiAction(target,objects);
  getDatabase().commit(true);
  getDatabase().begin();
}
Program: 117478
Project: 117478
Buggy source:
@Override protected void perfromSingleAction(ODocument object){
  object.delete();
}

Fixed version (ground truth):
@Override protected void perfromSingleAction(AjaxRequestTarget target,ODocument object){
  object.delete();
}
Program: 117479
Project: 117479
Buggy source:
@Override protected void performMultiAction(List<OIndex<?>> objects){
  getDatabase().commit();
  super.performMultiAction(objects);
  getDatabase().begin();
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<OIndex<?>> objects){
  getDatabase().commit();
  super.performMultiAction(target,objects);
  getDatabase().begin();
}
Program: 117480
Project: 117480
Buggy source:
@Override protected void perfromSingleAction(OIndex<?> object){
  getIndexManager().dropIndex(object.getName());
}

Fixed version (ground truth):
@Override protected void perfromSingleAction(AjaxRequestTarget target,OIndex<?> object){
  getIndexManager().dropIndex(object.getName());
}
Program: 117481
Project: 117481
Buggy source:
@Override protected void performMultiAction(List<OProperty> objects){
  getDatabase().commit();
  super.performMultiAction(objects);
  getDatabase().begin();
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<OProperty> objects){
  getDatabase().commit();
  super.performMultiAction(target,objects);
  getDatabase().begin();
}
Program: 117482
Project: 117482
Buggy source:
@Override protected void perfromSingleAction(OProperty object){
  object.getOwnerClass().dropProperty(object.getName());
}

Fixed version (ground truth):
@Override protected void perfromSingleAction(AjaxRequestTarget target,OProperty object){
  object.getOwnerClass().dropProperty(object.getName());
}
Program: 117483
Project: 117483
Buggy source:
@Override protected void initializeContent(ModalWindow modal){
  modal.setContent(new ImportDialogPanel(modal.getContentId(),modal));
}

Fixed version (ground truth):
@Override protected void initializeContent(ModalWindow modal){
  modal.setTitle(new ResourceModel("String_Node_Str"));
  modal.setContent(new ImportDialogPanel(modal.getContentId(),modal));
}
Program: 117484
Project: 117484
Buggy source:
@Override protected void performMultiAction(List<ODocument> objects){
  if (objects == null || objects.isEmpty())   return;
  ODocument doc=documentModel.getObject();
  if (doc != null) {
    OProperty property=propertyModel.getObject();
    if (property != null) {
      Collection<ODocument> collection=doc.field(property.getName());
      for (      ODocument oDocument : objects) {
        collection.remove(oDocument);
      }
      doc.save();
    }
  }
}

Fixed version (ground truth):
@Override protected void performMultiAction(AjaxRequestTarget target,List<ODocument> objects){
  if (objects == null || objects.isEmpty())   return;
  ODocument doc=documentModel.getObject();
  if (doc != null) {
    OProperty property=propertyModel.getObject();
    if (property != null) {
      Collection<ODocument> collection=doc.field(property.getName());
      for (      ODocument oDocument : objects) {
        collection.remove(oDocument);
      }
      doc.save();
    }
  }
}
Program: 117485
Project: 117485
Buggy source:
public LinksPropertyDataTablePanel(String id,IModel<ODocument> documentModel,OProperty property){
  super(id,documentModel);
  String sql;
  OClass linkedClass=property.getLinkedClass();
  boolean isCalculable=CustomAttributes.CALCULABLE.getValue(property,false);
  if (isCalculable) {
    sql=CustomAttributes.CALC_SCRIPT.getValue(property);
    sql=sql.replace("String_Node_Str","String_Node_Str");
  }
 else {
    sql="String_Node_Str" + property.getName() + "String_Node_Str"+ property.getOwnerClass().getName()+ "String_Node_Str";
  }
  OQueryDataProvider<ODocument> provider=new OQueryDataProvider<ODocument>(sql);
  provider.setParameter("String_Node_Str",documentModel);
  OrienteerDataTable<ODocument,String> table=new OrienteerDataTable<ODocument,String>("String_Node_Str",oClassIntrospector.getColumnsFor(linkedClass),provider,20);
  table.setCaptionModel(new OPropertyNamingModel(property));
  if (!isCalculable) {
    table.addCommand(new CreateODocumentCommand(table,documentModel,new OPropertyModel(property)));
    table.addCommand(new DeleteODocumentCommand(table,linkedClass));
  }
  add(table);
}

Fixed version (ground truth):
public LinksPropertyDataTablePanel(String id,IModel<ODocument> documentModel,OProperty property){
  super(id,documentModel);
  String sql;
  OClass linkedClass=property.getLinkedClass();
  boolean isCalculable=CustomAttributes.CALCULABLE.getValue(property,false);
  if (isCalculable) {
    sql=CustomAttributes.CALC_SCRIPT.getValue(property);
    sql=sql.replace("String_Node_Str","String_Node_Str");
  }
 else {
    sql="String_Node_Str" + property.getName() + "String_Node_Str"+ property.getOwnerClass().getName()+ "String_Node_Str";
  }
  OQueryDataProvider<ODocument> provider=new OQueryDataProvider<ODocument>(sql);
  provider.setParameter("String_Node_Str",documentModel);
  OrienteerDataTable<ODocument,String> table=new OrienteerDataTable<ODocument,String>("String_Node_Str",oClassIntrospector.getColumnsFor(linkedClass),provider,20);
  table.setCaptionModel(new OPropertyNamingModel(property));
  if (!isCalculable) {
    table.addCommand(new CreateODocumentCommand(table,documentModel,new OPropertyModel(property)));
    table.addCommand(new DeleteODocumentCommand(table,linkedClass));
    table.addCommand(new ReleaseODocumentCommand(table,documentModel,new OPropertyModel(property)));
  }
  add(table);
}
Program: 117486
Project: 117486
Buggy source:
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    ((AjaxRequestTarget)event.getPayload()).add(this);
  }
}

Fixed version (ground truth):
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    ((AjaxRequestTarget)event.getPayload()).add(this);
    event.stop();
  }
}
Program: 117487
Project: 117487
Buggy source:
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    ((AjaxRequestTarget)event.getPayload()).add(this);
  }
}

Fixed version (ground truth):
@Override public void onEvent(IEvent<?> event){
  if (event.getPayload() instanceof AjaxRequestTarget && Broadcast.BUBBLE.equals(event.getType())) {
    ((AjaxRequestTarget)event.getPayload()).add(this);
    event.stop();
  }
}
Program: 117488
Project: 117488
Buggy source:
@Override public void onInitialize(OrienteerWebApplication app,ODatabaseDocument db){
  app.getResourceSettings().getStringResourceLoaders().add(new OrienteerStringResourceLoader());
}

Fixed version (ground truth):
@Override public void onInitialize(OrienteerWebApplication app,ODatabaseDocument db){
  app.getResourceSettings().getStringResourceLoaders().add(new OrienteerStringResourceLoader());
  app.getOrientDbSettings().getORecordHooks().add(new ODocumentHookAbstract(){
{
      setIncludeClasses(OCLASS_LOCALIZATION);
    }
    private void invalidateCache(){
      OrienteerWebApplication app=OrienteerWebApplication.lookupApplication();
      if (app != null) {
        app.getResourceSettings().getLocalizer().clearCache();
      }
    }
    @Override public void onRecordAfterCreate(    ODocument iDocument){
      invalidateCache();
    }
    @Override public void onRecordAfterUpdate(    ODocument iDocument){
      invalidateCache();
    }
    @Override public void onRecordAfterDelete(    ODocument iDocument){
      invalidateCache();
    }
    @Override public DISTRIBUTED_EXECUTION_MODE getDistributedExecutionMode(){
      return DISTRIBUTED_EXECUTION_MODE.BOTH;
    }
  }
);
}
Program: 117489
Project: 117489
Buggy source:
@Override protected String execute(ODatabaseDocument db){
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>("String_Node_Str" + OCLASS_LOCALIZATION + "String_Node_Str"+ OPROPERTY_KEY+ "String_Node_Str");
  List<ODocument> result=db.command(query).execute(key);
  if (result == null || result.isEmpty()) {
    registerStringResourceRequest(key,language,style,variation);
    return null;
  }
  ODocument bestCandidate=null;
  int bestCandidateScore=-1;
  boolean fullMatchPresent=false;
  for (  ODocument candidate : result) {
    int score=0;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_LANG)))     score|=1 << 2;
    if (Strings.isEqual(style,(String)candidate.field(OPROPERTY_STYLE)))     score|=1 << 1;
    if (Strings.isEqual(variation,(String)candidate.field(OPROPERTY_VARIATION)))     score|=1;
    if (score == 7)     fullMatchPresent=true;
    Boolean active=candidate.field(OPROPERTY_ACTIVE);
    if (active == null || active)     score=-1;
    if (score > bestCandidateScore) {
      bestCandidate=candidate;
      bestCandidateScore=score;
    }
  }
  if (!fullMatchPresent) {
    registerStringResourceRequest(key,language,style,variation);
  }
  return bestCandidate != null ? (String)bestCandidate.field(OPROPERTY_VALUE) : null;
}

Fixed version (ground truth):
@Override protected String execute(ODatabaseDocument db){
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>("String_Node_Str" + OCLASS_LOCALIZATION + "String_Node_Str"+ OPROPERTY_KEY+ "String_Node_Str");
  List<ODocument> result=db.command(query).execute(key);
  if (result == null || result.isEmpty()) {
    registerStringResourceRequest(key,language,style,variation);
    return null;
  }
  ODocument bestCandidate=null;
  int bestCandidateScore=-1;
  boolean fullMatchPresent=false;
  for (  ODocument candidate : result) {
    int score=0;
    if (Strings.isEqual(language,(String)candidate.field(OPROPERTY_LANG)))     score|=1 << 2;
    if (Strings.isEqual(style,(String)candidate.field(OPROPERTY_STYLE)))     score|=1 << 1;
    if (Strings.isEqual(variation,(String)candidate.field(OPROPERTY_VARIATION)))     score|=1;
    if (score == 7)     fullMatchPresent=true;
    Boolean active=candidate.field(OPROPERTY_ACTIVE);
    if (active == null || !active)     score=-1;
    if (score > bestCandidateScore) {
      bestCandidate=candidate;
      bestCandidateScore=score;
    }
  }
  if (!fullMatchPresent) {
    registerStringResourceRequest(key,language,style,variation);
  }
  return bestCandidate != null ? (String)bestCandidate.field(OPROPERTY_VALUE) : null;
}
Program: 117491
Project: 117491
Buggy source:
@SuppressWarnings("String_Node_Str") public V getEnteredValue(){
  if (component instanceof FormComponent) {
    return ((FormComponent<V>)component).getConvertedInput();
  }
 else {
    return getValueObject();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public V getEnteredValue(){
  if (component instanceof FormComponent && ((FormComponent<V>)component).hasRawInput()) {
    FormComponent<V> formComponent=(FormComponent<V>)component;
    convertInput(formComponent);
    return formComponent.getConvertedInput();
  }
 else {
    return getValueObject();
  }
}
Program: 117493
Project: 117493
Buggy source:
private void registerStringResourceRequest(String key,String language,String style,String variation){
  ODocument doc=new ODocument(OCLASS_LOCALIZATION);
  doc.field(OPROPERTY_KEY,key);
  doc.field(OPROPERTY_LANG,language);
  doc.field(OPROPERTY_STYLE,style);
  doc.field(OPROPERTY_VARIATION,variation);
  doc.field(OPROPERTY_ACTIVE,false);
}

Fixed version (ground truth):
private void registerStringResourceRequest(String key,String language,String style,String variation){
  ODocument doc=new ODocument(OCLASS_LOCALIZATION);
  doc.field(OPROPERTY_KEY,key);
  doc.field(OPROPERTY_LANG,language);
  doc.field(OPROPERTY_STYLE,style);
  doc.field(OPROPERTY_VARIATION,variation);
  doc.field(OPROPERTY_ACTIVE,false);
  doc.save();
}
Program: 117494
Project: 117494
Buggy source:
@Override public void onInstall(OrienteerWebApplication app,ODatabaseDocument db){
  OSchema schema=app.getDatabase().getMetadata().getSchema();
  OClass oClass=mergeOClass(schema,OCLASS_LOCALIZATION);
  mergeOProperty(oClass,OPROPERTY_KEY,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_LANG,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_STYLE,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_VARIATION,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_ACTIVE,OType.BOOLEAN);
  mergeOProperty(oClass,OPROPERTY_VALUE,OType.STRING);
  mergeOIndex(oClass,"String_Node_Str",INDEX_TYPE.NOTUNIQUE,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onInstall(OrienteerWebApplication app,ODatabaseDocument db){
  OSchema schema=db.getMetadata().getSchema();
  OClass oClass=mergeOClass(schema,OCLASS_LOCALIZATION);
  mergeOProperty(oClass,OPROPERTY_KEY,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_LANG,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_STYLE,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_VARIATION,OType.STRING);
  mergeOProperty(oClass,OPROPERTY_ACTIVE,OType.BOOLEAN);
  mergeOProperty(oClass,OPROPERTY_VALUE,OType.STRING);
  mergeOIndex(oClass,"String_Node_Str",INDEX_TYPE.NOTUNIQUE,"String_Node_Str");
}
Program: 117495
Project: 117495
Buggy source:
@Override public void onConfigure(Component component){
  super.onConfigure(component);
  sourceComponent.configure();
  component.setVisibilityAllowed(component.isVisibilityAllowed() && sourceComponent.determineVisibility());
}

Fixed version (ground truth):
@Override public void onConfigure(Component component){
  super.onConfigure(component);
  sourceComponent.configure();
  component.setVisible(sourceComponent.determineVisibility());
}
Program: 117498
Project: 117498
Buggy source:
@Override public Tuple call(Tuple2<Object,Seq<Seq<Tuple>>> input){
  try {
    LOG.debug("String_Node_Str" + input);
    final Object key=input._1();
    Seq<Seq<Tuple>> bags=input._2();
    Iterable<Seq<Tuple>> bagsList=JavaConversions.asJavaIterable(bags);
    int i=0;
    List<Iterator<Tuple>> tupleIterators=new ArrayList();
    for (    Seq<Tuple> bag : bagsList) {
      Iterator<Tuple> iterator=JavaConversions.asJavaCollection(bag).iterator();
      final int index=i;
      tupleIterators.add(new IteratorTransform<Tuple,Tuple>(iterator){
        @Override protected Tuple transform(        Tuple next){
          try {
            Tuple tuple=tf.newTuple(3);
            tuple.set(0,index);
            tuple.set(1,key);
            tuple.set(2,next);
            return tuple;
          }
 catch (          ExecException e) {
            throw new RuntimeException(e);
          }
        }
      }
);
      ++i;
    }
    Tuple out=tf.newTuple(2);
    out.set(0,key);
    out.set(1,new IteratorUnion<Tuple>(tupleIterators.iterator()));
    LOG.debug("String_Node_Str" + out);
    return out;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public Tuple call(Tuple2<Object,Seq<Seq<Tuple>>> input){
  try {
    final Object key=input._1();
    Seq<Seq<Tuple>> bags=input._2();
    Iterable<Seq<Tuple>> bagsList=JavaConversions.asJavaIterable(bags);
    int i=0;
    List<Iterator<Tuple>> tupleIterators=new ArrayList();
    for (    Seq<Tuple> bag : bagsList) {
      Iterator<Tuple> iterator=JavaConversions.asJavaCollection(bag).iterator();
      final int index=i;
      tupleIterators.add(new IteratorTransform<Tuple,Tuple>(iterator){
        @Override protected Tuple transform(        Tuple next){
          try {
            Tuple tuple=tf.newTuple(3);
            tuple.set(0,index);
            tuple.set(1,key);
            tuple.set(2,next);
            return tuple;
          }
 catch (          ExecException e) {
            throw new RuntimeException(e);
          }
        }
      }
);
      ++i;
    }
    Tuple out=tf.newTuple(2);
    out.set(0,key);
    out.set(1,new IteratorUnion<Tuple>(tupleIterators.iterator()));
    return out;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 117499
Project: 117499
Buggy source:
private void readNext(){
  try {
    if (result != null && !returned) {
      return;
    }
    if (result == null) {
      if (!input.hasNext()) {
        finished=true;
        return;
      }
      Tuple v1=input.next();
      attach(v1);
    }
    result=getNextResult();
    returned=false;
switch (result.returnStatus) {
case POStatus.STATUS_OK:
      returned=false;
    break;
case POStatus.STATUS_NULL:
  returned=true;
readNext();
break;
case POStatus.STATUS_EOP:
finished=!input.hasNext();
if (!finished) {
result=null;
readNext();
}
break;
case POStatus.STATUS_ERR:
throw new RuntimeException("String_Node_Str" + result);
}
}
 catch (ExecException e) {
throw new RuntimeException(e);
}
}

Fixed version (ground truth):
private void readNext(){
  try {
    if (result != null && !returned) {
      return;
    }
    if (result == null) {
      if (!input.hasNext()) {
        finished=true;
        return;
      }
      vt=input.next();
      attach(vt);
    }
    result=getNextResult();
    returned=false;
switch (result.returnStatus) {
case POStatus.STATUS_OK:
      returned=false;
    break;
case POStatus.STATUS_NULL:
  returned=true;
readNext();
break;
case POStatus.STATUS_EOP:
finished=!input.hasNext();
if (!finished) {
result=null;
readNext();
}
break;
case POStatus.STATUS_ERR:
throw new RuntimeException("String_Node_Str" + result);
}
}
 catch (ExecException e) {
throw new RuntimeException(e);
}
}
Program: 117500
Project: 117500
Buggy source:
protected static SchemaTupleFactory newSchemaTupleFactory(int id){
  if (stb == null) {
    throw new RuntimeException("String_Node_Str");
  }
  return stb.internalNewSchemaTupleFactory(id);
}

Fixed version (ground truth):
protected static SchemaTupleFactory newSchemaTupleFactory(int id){
  LOG.info("String_Node_Str" + stb);
  if (stb == null) {
    throw new RuntimeException("String_Node_Str");
  }
  return stb.internalNewSchemaTupleFactory(id);
}
Program: 117501
Project: 117501
Buggy source:
public static void initialize(Configuration jConf,PigContext pigContext,boolean isLocal) throws IOException {
  if (stb != null) {
    LOG.warn("String_Node_Str");
  }
 else {
    SchemaTupleFrontend.lazyReset(pigContext);
    SchemaTupleFrontend.reset();
    SchemaTupleBackend stbInstance=new SchemaTupleBackend(jConf,isLocal);
    stbInstance.copyAndResolve();
    stb=stbInstance;
  }
}

Fixed version (ground truth):
public static void initialize(Configuration jConf,PigContext pigContext,boolean isLocal) throws IOException {
  if (stb != null) {
    LOG.warn("String_Node_Str");
  }
 else {
    SchemaTupleFrontend.lazyReset(pigContext);
    SchemaTupleFrontend.reset();
    SchemaTupleBackend stbInstance=new SchemaTupleBackend(jConf,isLocal);
    stbInstance.copyAndResolve();
    stb=stbInstance;
  }
  LOG.info("String_Node_Str" + stb);
}
Program: 117502
Project: 117502
Buggy source:
/** 
 * The only information this class needs is a directory of generated code to resolve classes in.
 * @param jConf
 * @param directory of generated code
 */
private SchemaTupleBackend(Configuration jConf,boolean isLocal){
  if (isLocal) {
    String localCodeDir=jConf.get(PigConstants.LOCAL_CODE_DIR);
    if (localCodeDir == null) {
      LOG.debug("String_Node_Str");
      abort=true;
      return;
    }
    codeDir=new File(jConf.get(PigConstants.LOCAL_CODE_DIR));
  }
 else {
    codeDir=Files.createTempDir();
    codeDir.deleteOnExit();
  }
  try {
    classLoader=new URLClassLoader(new URL[]{codeDir.toURI().toURL()});
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException("String_Node_Str" + codeDir.getAbsolutePath());
  }
  this.jConf=jConf;
  this.isLocal=isLocal;
}

Fixed version (ground truth):
/** 
 * The only information this class needs is a directory of generated code to resolve classes in.
 * @param jConf
 * @param directory of generated code
 */
private SchemaTupleBackend(Configuration jConf,boolean isLocal){
  if (isLocal) {
    String localCodeDir=jConf.get(PigConstants.LOCAL_CODE_DIR);
    if (localCodeDir == null) {
      LOG.debug("String_Node_Str");
      abort=true;
      return;
    }
    codeDir=new File(jConf.get(PigConstants.LOCAL_CODE_DIR));
  }
 else {
    codeDir=Files.createTempDir();
    codeDir.deleteOnExit();
  }
  try {
    classLoader=new URLClassLoader(new URL[]{codeDir.toURI().toURL()});
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException("String_Node_Str" + codeDir.getAbsolutePath());
  }
  SchemaTupleBackend.jConf=jConf;
  this.isLocal=isLocal;
}
Program: 117504
Project: 117504
Buggy source:
public void addResource(String reference,Object resource){
  storage.put(reference,resource);
}

Fixed version (ground truth):
public void addResource(String schema,String reference,Object resource){
  if (schema.equalsIgnoreCase("String_Node_Str")) {
    Stack<Object> tmp_stack=stack;
    Iterator<Object> iterator=tmp_stack.iterator();
    boolean found=false;
    while (iterator.hasNext()) {
      if (iterator.next().equals(resource)) {
        found=true;
      }
    }
    if (!found) {
      stack.push((Object)resource);
      storage.put(reference,resource);
    }
  }
}