nus-yam/ex-repair huggingface dataset:
Program: 186519
Project: 186519
Buggy source:
/** 
 * Constructor
 * @param id the markup-id
 * @param model the {@link IModel}
 * @param toolbar the {@link IWysiwygToolbar}
 */
public WysiwygEditor(String id,IModel<String> model,IWysiwygToolbar toolbar){
  super(id,model);
  this.container=new WebMarkupContainer("String_Node_Str");
  this.add(this.container);
  this.textarea=new TextArea<String>("String_Node_Str",Model.of(this.getModelObject()));
  this.textarea.setEscapeModelStrings(false);
  this.add(this.textarea.setOutputMarkupId(true));
  if (toolbar != null) {
    toolbar.attachToEditor(this.container);
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param id the markup-id
 * @param model the {@link IModel}
 * @param toolbar the {@link IWysiwygToolbar}
 */
public WysiwygEditor(String id,IModel<String> model,IWysiwygToolbar toolbar){
  super(id,model);
  this.container=new WebMarkupContainer("String_Node_Str");
  this.add(this.container);
  if (toolbar != null) {
    toolbar.attachToEditor(this.container);
  }
}
Program: 186520
Project: 186520
Buggy source:
@Override protected void onInitialize(){
  super.onInitialize();
  this.add(JQueryWidget.newWidgetBehavior(this,this.container));
}

Fixed version (ground truth):
@Override protected void onInitialize(){
  super.onInitialize();
  this.textarea=new TextArea<String>("String_Node_Str",this.getModel());
  this.textarea.setEscapeModelStrings(false);
  this.add(this.textarea.setOutputMarkupId(true));
  this.add(JQueryWidget.newWidgetBehavior(this,this.container));
}
Program: 186522
Project: 186522
Buggy source:
/** 
 * Constructor
 * @param title {@link IModel} that represent the title of the menu-item
 */
public AbstractSfMenuItem(IModel<String> title,Class<? extends Page> pageClass){
  this.title=title;
  this.pageClass=pageClass;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param title {@link IModel} that represent the title of the menu-item
 */
public AbstractSfMenuItem(IModel<String> title,Class<? extends Page> pageClass){
  this.title=title;
  if (pageClass != null) {
    this.pageClassProvider=new ClassReference(pageClass);
  }
 else {
    this.pageClassProvider=null;
  }
}
Program: 186523
Project: 186523
Buggy source:
/** 
 * Get the page class registered with the link
 * @return Page Class
 */
public Class<? extends Page> getPageClass(){
  return pageClass;
}

Fixed version (ground truth):
/** 
 * Get the page class registered with the link
 * @return Page Class
 */
public Class<? extends Page> getPageClass(){
  if (pageClassProvider != null) {
    return pageClassProvider.get();
  }
  return null;
}
Program: 186524
Project: 186524
Buggy source:
@Override protected void populateItem(ListItem<ISfMenuItem> item){
  ISfMenuItem menuItem=item.getModelObject();
  item.add(new ItemFragment("String_Node_Str",menuItem));
  item.add(new MenuFragment("String_Node_Str",menuItem.getItems()));
  item.add(AttributeModifier.replace("String_Node_Str",menuItem.getId()));
}

Fixed version (ground truth):
@Override protected void populateItem(ListItem<ISfMenuItem> item){
  ISfMenuItem menuItem=item.getModelObject();
  item.add(new ItemFragment("String_Node_Str",menuItem));
  item.add(new MenuFragment("String_Node_Str",menuItem.getItems()));
}
Program: 186525
Project: 186525
Buggy source:
public ListFragment(String id,List<ISfMenuItem> items){
  super(id,"String_Node_Str",SfMenu.this);
  this.add(new ListView<ISfMenuItem>("String_Node_Str",items){
    private static final long serialVersionUID=1L;
    @Override protected void populateItem(    ListItem<ISfMenuItem> item){
      ISfMenuItem menuItem=item.getModelObject();
      item.add(new ItemFragment("String_Node_Str",menuItem));
      item.add(new MenuFragment("String_Node_Str",menuItem.getItems()));
      item.add(AttributeModifier.replace("String_Node_Str",menuItem.getId()));
    }
  }
);
}

Fixed version (ground truth):
public ListFragment(String id,List<ISfMenuItem> items){
  super(id,"String_Node_Str",SfMenu.this);
  this.add(new ListView<ISfMenuItem>("String_Node_Str",items){
    private static final long serialVersionUID=1L;
    @Override protected void populateItem(    ListItem<ISfMenuItem> item){
      ISfMenuItem menuItem=item.getModelObject();
      item.add(new ItemFragment("String_Node_Str",menuItem));
      item.add(new MenuFragment("String_Node_Str",menuItem.getItems()));
    }
  }
);
}
Program: 186526
Project: 186526
Buggy source:
/** 
 * Constructor
 * @param selector
 * @param options
 */
public SfMenuBehavior(String selector,Options options,Boolean verticalSfMenu){
  super(selector,METHOD,options);
  this.add(new CssResourceReference(SfMenuBehavior.class,"String_Node_Str"));
  if (verticalSfMenu) {
    this.add(new CssResourceReference(SfMenuBehavior.class,"String_Node_Str"));
  }
  this.add(new JavaScriptResourceReference(SfMenuBehavior.class,"String_Node_Str"));
  this.add(new JavaScriptResourceReference(SfMenuBehavior.class,"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param selector
 * @param options
 */
public SfMenuBehavior(String selector,Options options,Boolean verticalSfMenu){
  super(selector,METHOD,options);
  ISuperfishLibrarySettings settings=getLibrarySettings();
  if (settings.getSuperfishStyleSheetReference() != null) {
    this.add(settings.getSuperfishStyleSheetReference());
  }
  if (verticalSfMenu && settings.getSuperfishVerticalStyleSheetReference() != null) {
    this.add(settings.getSuperfishVerticalStyleSheetReference());
  }
  this.add(HoverIntentJavaScriptResourceReference.get());
  this.add(SuperfishJavaScriptResourceReference.get());
}
Program: 186527
Project: 186527
Buggy source:
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  target.add(accordion.setActiveTab(2));
}

Fixed version (ground truth):
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  target.add(accordion.setActiveTab(accordion.getLastTabIndex()));
}
Program: 186528
Project: 186528
Buggy source:
private List<ITab> newTabList(){
  List<ITab> tabs=new ArrayList<ITab>();
  tabs.add(new SimpleTab(new Model<String>("String_Node_Str"),new Model<String>("String_Node_Str")));
  tabs.add(new AbstractTab(new Model<String>("String_Node_Str")){
    private static final long serialVersionUID=1L;
    @Override public WebMarkupContainer getPanel(    String panelId){
      return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
    }
  }
);
  tabs.add(new AjaxTab(new Model<String>("String_Node_Str")){
    private static final long serialVersionUID=1L;
    @Override public WebMarkupContainer getLazyPanel(    String panelId){
      try {
        Thread.sleep(750);
      }
 catch (      InterruptedException e) {
        error(e.getMessage());
      }
      return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
    }
  }
);
  return tabs;
}

Fixed version (ground truth):
private List<ITab> newTabList(){
  List<ITab> tabs=new ArrayList<ITab>();
  tabs.add(new SimpleTab(new Model<String>("String_Node_Str"),new Model<String>("String_Node_Str")));
  tabs.add(new SimpleTab(new Model<String>("String_Node_Str"),Model.of("String_Node_Str")){
    private static final long serialVersionUID=1L;
    @Override public boolean isVisible(){
      return false;
    }
  }
);
  tabs.add(new AbstractTab(new Model<String>("String_Node_Str")){
    private static final long serialVersionUID=1L;
    @Override public WebMarkupContainer getPanel(    String panelId){
      return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
    }
  }
);
  tabs.add(new AjaxTab(new Model<String>("String_Node_Str")){
    private static final long serialVersionUID=1L;
    @Override public WebMarkupContainer getLazyPanel(    String panelId){
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException e) {
        error(e.getMessage());
      }
      return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
    }
  }
);
  return tabs;
}
Program: 186529
Project: 186529
Buggy source:
public AccordionPanelPage(){
  final Form<?> form=new Form<Void>("String_Node_Str");
  this.add(form);
  final FeedbackPanel feedback=new JQueryFeedbackPanel("String_Node_Str");
  form.add(feedback.setOutputMarkupId(true));
  Options options=new Options();
  options.set("String_Node_Str",Options.asString("String_Node_Str"));
  final AccordionPanel accordion=new AccordionPanel("String_Node_Str",this.newTabList(),options){
    private static final long serialVersionUID=1L;
    @Override public void onActivate(    AjaxRequestTarget target,    int index,    ITab tab){
      info(String.format("String_Node_Str",index,tab.getTitle().getObject()));
      target.add(feedback);
    }
  }
;
  form.add(accordion);
  form.add(new AjaxButton("String_Node_Str"){
    private static final long serialVersionUID=1L;
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      target.add(accordion.setActiveTab(2));
    }
  }
);
}

Fixed version (ground truth):
public AccordionPanelPage(){
  final Form<?> form=new Form<Void>("String_Node_Str");
  this.add(form);
  final FeedbackPanel feedback=new JQueryFeedbackPanel("String_Node_Str");
  form.add(feedback.setOutputMarkupId(true));
  Options options=new Options();
  options.set("String_Node_Str",Options.asString("String_Node_Str"));
  final AccordionPanel accordion=new AccordionPanel("String_Node_Str",this.newTabList(),options){
    private static final long serialVersionUID=1L;
    @Override public void onActivate(    AjaxRequestTarget target,    int index,    ITab tab){
      info(String.format("String_Node_Str",index,tab.getTitle().getObject()));
      target.add(feedback);
    }
  }
;
  form.add(accordion);
  form.add(new AjaxButton("String_Node_Str"){
    private static final long serialVersionUID=1L;
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      target.add(accordion.setActiveTab(accordion.getLastTabIndex()));
    }
  }
);
}
Program: 186530
Project: 186530
Buggy source:
@Override public WebMarkupContainer getLazyPanel(String panelId){
  try {
    Thread.sleep(750);
  }
 catch (  InterruptedException e) {
    error(e.getMessage());
  }
  return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
}

Fixed version (ground truth):
@Override public WebMarkupContainer getLazyPanel(String panelId){
  try {
    Thread.sleep(500);
  }
 catch (  InterruptedException e) {
    error(e.getMessage());
  }
  return new Fragment(panelId,"String_Node_Str",AccordionPanelPage.this);
}
Program: 186531
Project: 186531
Buggy source:
@Override public void onAjax(AjaxRequestTarget target,JQueryEvent event){
  if (event instanceof ActivateEvent) {
    int index=((ActivateEvent)event).getIndex();
    if (-1 < index && index < this.getTabs().size()) {
      ITab tab=this.getTabs().get(index);
      if (tab instanceof AjaxTab) {
        ((AjaxTab)tab).load(target);
      }
      this.onActivate(target,index,tab);
    }
  }
}

Fixed version (ground truth):
@Override public void onAjax(AjaxRequestTarget target,JQueryEvent event){
  if (event instanceof ActivateEvent) {
    int index=((ActivateEvent)event).getIndex();
    List<ITab> tabs=this.getVisibleTabs();
    if (-1 < index && index < tabs.size()) {
      ITab tab=tabs.get(index);
      if (tab instanceof AjaxTab) {
        ((AjaxTab)tab).load(target);
      }
      this.onActivate(target,index,tab);
    }
  }
}
Program: 186532
Project: 186532
Buggy source:
@Override protected LoopItem newItem(final int index){
  return new LoopItem(index){
    private static final long serialVersionUID=1L;
    @Override protected void onConfigure(){
      super.onConfigure();
      ITab tab=AccordionPanel.this.getModelObject().get(index);
      setVisible(tab.isVisible());
    }
  }
;
}

Fixed version (ground truth):
@Override protected LoopItem newItem(final int index){
  return new LoopItem(index){
    private static final long serialVersionUID=1L;
    @Override protected void onConfigure(){
      super.onConfigure();
      ITab tab=AccordionPanel.this.getModelObject().get(index);
      this.setVisible(tab.isVisible());
    }
  }
;
}
Program: 186533
Project: 186533
Buggy source:
@Override protected void onInitialize(){
  super.onInitialize();
  this.add(new Loop("String_Node_Str",this.getCountModel()){
    private static final long serialVersionUID=1L;
    @Override protected LoopItem newItem(    final int index){
      return new LoopItem(index){
        private static final long serialVersionUID=1L;
        @Override protected void onConfigure(){
          super.onConfigure();
          ITab tab=AccordionPanel.this.getModelObject().get(index);
          setVisible(tab.isVisible());
        }
      }
;
    }
    @Override protected void populateItem(    LoopItem item){
      int index=item.getIndex();
      final ITab tab=AccordionPanel.this.getModelObject().get(index);
      item.add(AccordionPanel.this.newTitleLabel("String_Node_Str",tab.getTitle()));
      item.add(tab.getPanel("String_Node_Str"));
    }
  }
);
  this.add(this.widgetBehavior=this.newWidgetBehavior(JQueryWidget.getSelector(this)));
}

Fixed version (ground truth):
@Override protected void onInitialize(){
  super.onInitialize();
  this.add(new Loop("String_Node_Str",this.getCountModel()){
    private static final long serialVersionUID=1L;
    @Override protected LoopItem newItem(    final int index){
      return new LoopItem(index){
        private static final long serialVersionUID=1L;
        @Override protected void onConfigure(){
          super.onConfigure();
          ITab tab=AccordionPanel.this.getModelObject().get(index);
          this.setVisible(tab.isVisible());
        }
      }
;
    }
    @Override protected void populateItem(    LoopItem item){
      int index=item.getIndex();
      final ITab tab=AccordionPanel.this.getModelObject().get(index);
      item.add(AccordionPanel.this.newTitleLabel("String_Node_Str",tab.getTitle()));
      item.add(tab.getPanel("String_Node_Str"));
    }
  }
);
  this.add(this.widgetBehavior=this.newWidgetBehavior(JQueryWidget.getSelector(this)));
}
Program: 186534
Project: 186534
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  ITab tab=AccordionPanel.this.getModelObject().get(index);
  setVisible(tab.isVisible());
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  ITab tab=AccordionPanel.this.getModelObject().get(index);
  this.setVisible(tab.isVisible());
}
Program: 186535
Project: 186535
Buggy source:
/** 
 * Constructor
 * @param title {@link IModel} that represent the title of the menu-item
 * @param icon the icon css class (ie: ui-my-icon)
 */
public AbstractMenuItem(IModel<String> title,String icon){
  this.title=title;
  this.icon=icon;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param title {@link IModel} that represent the title of the menu-item
 * @param icon the icon css class; <code>'ui-icon-blank'</code> or {@link JQueryIcon#BLANK} may be used to not display any icon.
 */
public AbstractMenuItem(IModel<String> title,String icon){
  this.title=title;
  this.icon=icon;
}
Program: 186536
Project: 186536
Buggy source:
@Override public String getText(T object,String expression){
  if (expression != null) {
    Object value=PropertyResolver.getValue(expression,object);
    if (value != null) {
      return value.toString();
    }
  }
  if (object != null) {
    return object.toString();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getText(T object,String expression){
  if (expression != null) {
    Object value=PropertyResolver.getValue(expression,object);
    if (value != null) {
      return value.toString();
    }
  }
  return "String_Node_Str";
}
Program: 186537
Project: 186537
Buggy source:
/** 
 * Adds a reference to be added at   {@link #renderHead(Component,IHeaderResponse)} time.
 * @param reference a {@link CssResourceReference}, a   {@link JavaScriptResourceReference}
 * @return true (as specified by Collection.add(E)) 
 */
protected boolean add(ResourceReference reference){
  return this.references.add(reference);
}

Fixed version (ground truth):
/** 
 * Adds a reference to be added at   {@link #renderHead(Component,IHeaderResponse)} time.
 * @param reference a {@link CssResourceReference} or a {@link JavaScriptResourceReference}
 * @return true (as specified by Collection.add(E)) 
 */
protected boolean add(ResourceReference reference){
  return this.references.add(reference);
}
Program: 186538
Project: 186538
Buggy source:
@Override public void renderHead(Component component,IHeaderResponse response){
  response.renderJavaScriptReference(JQueryAbstractBehavior.CORE_JS);
  response.renderJavaScriptReference(JQueryAbstractBehavior.CORE_UI);
  for (  ResourceReference reference : this.references) {
    if (reference instanceof JavaScriptResourceReference) {
      response.renderJavaScriptReference(reference);
    }
    if (reference instanceof CssResourceReference) {
      response.renderCSSReference(reference);
    }
  }
  response.renderJavaScript(this.$(),this.getToken());
}

Fixed version (ground truth):
@Override public void renderHead(Component component,IHeaderResponse response){
  if (JQueryLibrarySettings.CORE_JS != null) {
    response.renderJavaScriptReference(JQueryLibrarySettings.CORE_JS);
  }
  if (JQueryLibrarySettings.CORE_UI != null) {
    response.renderJavaScriptReference(JQueryLibrarySettings.CORE_UI);
  }
  for (  ResourceReference reference : this.references) {
    if (reference instanceof JavaScriptResourceReference) {
      response.renderJavaScriptReference(reference);
    }
    if (reference instanceof CssResourceReference) {
      response.renderCSSReference(reference);
    }
  }
  response.renderJavaScript(this.$(),this.getToken());
}
Program: 186539
Project: 186539
Buggy source:
@Override public void renderHead(Component component,IHeaderResponse response){
  super.renderHead(component,response);
  response.renderJavaScriptReference(JQueryAbstractBehavior.CORE_JS);
  response.renderJavaScriptReference(JQueryAbstractTemplateBehavior.TMPL_JS);
  response.renderString(this.newResourceStream().getString());
}

Fixed version (ground truth):
@Override public void renderHead(Component component,IHeaderResponse response){
  super.renderHead(component,response);
  if (JQueryLibrarySettings.CORE_JS != null) {
    response.renderJavaScriptReference(JQueryLibrarySettings.CORE_JS);
  }
  response.renderJavaScriptReference(JQueryAbstractTemplateBehavior.TMPL_JS);
  response.renderString(this.newResourceStream().getString());
}
Program: 186540
Project: 186540
Buggy source:
@Override public void onClick(AjaxRequestTarget target){
  if (AjaxTab.this.state == STATE_LOAD) {
    Component inner=AjaxTab.this.panel.getInnerLabel();
    Component panel=AjaxTab.this.getLazyPanel();
    target.add(inner.replaceWith(panel));
    AjaxTab.this.state=STATE_ADDED;
    this.getPage().dirty();
  }
}

Fixed version (ground truth):
@Override public void onClick(AjaxRequestTarget target){
  if (AjaxTab.this.state == STATE_LOAD) {
    AjaxTab.this.container=AjaxTab.this.getLazyPanel();
    target.add(AjaxTab.this.replaceComponent());
    AjaxTab.this.state=STATE_ADDED;
    this.getPage().dirty();
  }
}
Program: 186541
Project: 186541
Buggy source:
/** 
 * Gets the default panel (loading indicator)
 */
public final Panel getPanel(String panelId){
  this.panel=new LoadingPanel(panelId);
  this.state=STATE_LOAD;
  return this.panel;
}

Fixed version (ground truth):
/** 
 * Gets the default panel (loading indicator)
 */
public final WebMarkupContainer getPanel(String panelId){
  this.panel=new LoadingPanel(panelId);
  if (this.state == STATE_INIT) {
    this.state=STATE_LOAD;
  }
 else   if (this.state == STATE_ADDED) {
    this.replaceComponent();
  }
  return this.panel;
}
Program: 186542
Project: 186542
Buggy source:
/** 
 * Gets the   {@link AjaxLink} for this {@link ITab}, which will handle the lazy-panel load.
 * @param id the markup id
 * @return the {@link AjaxLink}
 */
public AjaxLink<Void> newLink(String id){
  return new AjaxLink<Void>(id){
    private static final long serialVersionUID=1L;
    @Override public void onClick(    AjaxRequestTarget target){
      if (AjaxTab.this.state == STATE_LOAD) {
        Component inner=AjaxTab.this.panel.getInnerLabel();
        Component panel=AjaxTab.this.getLazyPanel();
        target.add(inner.replaceWith(panel));
        AjaxTab.this.state=STATE_ADDED;
        this.getPage().dirty();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Gets the   {@link AjaxLink} for this {@link ITab}, which will handle the lazy-panel load.
 * @param id the markup id
 * @return the {@link AjaxLink}
 */
public AjaxLink<Void> newLink(String id){
  return new AjaxLink<Void>(id){
    private static final long serialVersionUID=1L;
    @Override public void onClick(    AjaxRequestTarget target){
      if (AjaxTab.this.state == STATE_LOAD) {
        AjaxTab.this.container=AjaxTab.this.getLazyPanel();
        target.add(AjaxTab.this.replaceComponent());
        AjaxTab.this.state=STATE_ADDED;
        this.getPage().dirty();
      }
    }
  }
;
}
Program: 186543
Project: 186543
Buggy source:
private static void f_monitorexit(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.unlock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    throw JVMHelp.IMSExc;
  }
  entry_count[index]--;
  c.lockLevel--;
  if (entry_count[index] == 0) {
    if (queue_front[index] == queue_back[index]) {
      queue_front[index]=0;
      queue_back[index]=0;
      cam.RESET=0;
      entries--;
    }
 else {
      queue_front[index]=c.lockQueue;
    }
    c.lockQueue=0;
  }
  if (c.lockLevel == 0) {
    Native.wr(0xffffffff,Const.IO_INTMASK);
  }
  Native.unlock();
}

Fixed version (ground truth):
private static void f_monitorexit(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.unlock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    throw JVMHelp.IMSExc;
  }
  entry_count[index]--;
  c.lockLevel--;
  if (entry_count[index] == 0) {
    if (queue_front[index] == 0) {
      cam.RESET=0;
      entries--;
    }
 else {
      int new_owner=queue_front[index];
      current_owner[index]=new_owner;
      RtThreadImpl t=Native.toRtThreadImpl(new_owner);
      if (t.lockQueue != 0) {
        queue_front[index]=t.lockQueue;
      }
 else {
        queue_front[index]=0;
        queue_back[index]=0;
      }
      t.lockQueue=0;
    }
    if (c.lockLevel == 0) {
      Native.wr(0xffffffff,Const.IO_INTMASK);
    }
  }
  Native.unlock();
}
Program: 186544
Project: 186544
Buggy source:
private static void f_monitorenter(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.lock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    entries++;
    if (entries >= Const.CAM_SIZE) {
      throw JVMHelp.IMSExc;
    }
    queue_front[index]=current_thread;
    queue_back[index]=queue_front[index];
  }
 else {
    if (queue_front[index] != current_thread) {
      RtThreadImpl t=Native.toRtThreadImpl(queue_back[index]);
      t.lockQueue=current_thread;
      queue_back[index]=current_thread;
      Native.wr(0xfffffffe,Const.IO_INTMASK);
      Native.unlock();
      for (; ; ) {
        Native.lock();
        if (queue_front[index] == current_thread) {
          break;
        }
        Native.unlock();
      }
    }
  }
  c.lockLevel++;
  entry_count[index]++;
  Native.unlock();
}

Fixed version (ground truth):
private static void f_monitorenter(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.lock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    entries++;
    if (entries >= Const.CAM_SIZE) {
      throw JVMHelp.IMSExc;
    }
    current_owner[index]=current_thread;
  }
 else {
    if (current_owner[index] != current_thread) {
      if (queue_front[index] == 0) {
        queue_front[index]=current_thread;
        queue_back[index]=current_thread;
      }
 else {
        RtThreadImpl t=Native.toRtThreadImpl(queue_back[index]);
        t.lockQueue=current_thread;
        queue_back[index]=current_thread;
      }
      Native.wr(0xfffffffe,Const.IO_INTMASK);
      Native.unlock();
      for (; ; ) {
        Native.lock();
        if (current_owner[index] == current_thread) {
          break;
        }
        Native.unlock();
      }
    }
  }
  c.lockLevel++;
  entry_count[index]++;
  Native.unlock();
}
Program: 186545
Project: 186545
Buggy source:
private static void f_monitorexit(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.unlock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    throw JVMHelp.IMSExc;
  }
  entry_count[index]--;
  if (entry_count[index] == 0) {
    Native.wr(0xffffffff,Const.IO_INTMASK);
    if (queue_front[index] == queue_back[index]) {
      queue_front[index]=0;
      queue_back[index]=0;
      cam.RESET=0;
      entries--;
    }
 else {
      queue_front[index]=c.lockQueue;
      c.lockQueue=0;
    }
  }
  Native.unlock();
}

Fixed version (ground truth):
private static void f_monitorexit(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.unlock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    throw JVMHelp.IMSExc;
  }
  entry_count[index]--;
  c.lockLevel--;
  if (entry_count[index] == 0) {
    if (queue_front[index] == queue_back[index]) {
      queue_front[index]=0;
      queue_back[index]=0;
      cam.RESET=0;
      entries--;
    }
 else {
      queue_front[index]=c.lockQueue;
    }
    c.lockQueue=0;
  }
  if (c.lockLevel == 0) {
    Native.wr(0xffffffff,Const.IO_INTMASK);
  }
  Native.unlock();
}
Program: 186546
Project: 186546
Buggy source:
private static void f_monitorenter(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.lock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    entries++;
    if (entries >= Const.CAM_SIZE) {
      throw JVMHelp.IMSExc;
    }
 else {
      queue_front[index]=current_thread;
      queue_back[index]=queue_front[index];
    }
  }
 else {
    if (queue_front[index] != current_thread) {
      RtThreadImpl t=Native.toRtThreadImpl(queue_back[index]);
      t.lockQueue=current_thread;
      queue_back[index]=current_thread;
      Native.wr(0xfffffffe,Const.IO_INTMASK);
      Native.unlock();
      for (; ; ) {
        Native.lock();
        if (queue_front[index] == current_thread) {
          break;
        }
        Native.unlock();
      }
    }
  }
  entry_count[index]++;
  Native.unlock();
}

Fixed version (ground truth):
private static void f_monitorenter(int objAddr){
  if (!RtThreadImpl.useLocks || objAddr == 0) {
    Native.lock();
    return;
  }
  Scheduler s=Scheduler.sched[Native.rd(Const.IO_CPU_ID)];
  RtThreadImpl c=s.ref[s.active];
  Native.lock();
  cam.ADDRESS=objAddr;
  int result=cam.ADDRESS;
  int index=result & 0x7FFFFFFF;
  int current_thread=Native.toInt(c);
  if ((result & 0x80000000) == 0) {
    entries++;
    if (entries >= Const.CAM_SIZE) {
      throw JVMHelp.IMSExc;
    }
    queue_front[index]=current_thread;
    queue_back[index]=queue_front[index];
  }
 else {
    if (queue_front[index] != current_thread) {
      RtThreadImpl t=Native.toRtThreadImpl(queue_back[index]);
      t.lockQueue=current_thread;
      queue_back[index]=current_thread;
      Native.wr(0xfffffffe,Const.IO_INTMASK);
      Native.unlock();
      for (; ; ) {
        Native.lock();
        if (queue_front[index] == current_thread) {
          break;
        }
        Native.unlock();
      }
    }
  }
  c.lockLevel++;
  entry_count[index]++;
  Native.unlock();
}
Program: 186549
Project: 186549
Buggy source:
@Override public void run(){
  ArrayReferenceTest.terminal.writeln("String_Node_Str");
  Object[] Array=new Object[10];
  int i=Native.rdMem(Native.toInt(Array) + GC.getOffSpace());
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + i);
  for (int j=0; j < Array.length; j++) {
    Array[j]=new Object();
  }
  int j=Native.rdMem(Native.toInt(Array[0]) + GC.getOffSpace());
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + j);
  i=Native.rdMem(Native.toInt(Array) + GC.getOffSpace());
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + i);
}

Fixed version (ground truth):
@Override public void run(){
  ArrayReferenceTest.terminal.writeln("String_Node_Str");
  Object[] Array=new Object[10];
  int i=Native.rdMem(Native.toInt(Array) + GC.OFF_SCOPE_LEVEL);
  System.out.println(Native.toInt(Array) + GC.OFF_SCOPE_LEVEL);
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + i);
  for (int j=0; j < Array.length; j++) {
    Array[j]=new Object();
  }
  int j=Native.rdMem(Native.toInt(Array[0]) + GC.OFF_SCOPE_LEVEL);
  System.out.println(Native.toInt(Array[0]) + GC.OFF_SCOPE_LEVEL);
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + j);
  i=Native.rdMem(Native.toInt(Array) + GC.OFF_SCOPE_LEVEL);
  System.out.println(Native.toInt(Array) + GC.OFF_SCOPE_LEVEL);
  ArrayReferenceTest.terminal.writeln("String_Node_Str" + i);
}
Program: 186550
Project: 186550
Buggy source:
/** 
 * If this is the implementation of a virtual/interface invoke instruction, return the InvokeNode for the virtual invoke instruction. TODO: This can be removed, if we ever remove   {@link ControlFlowGraph#resolveVirtualInvokes()}
 * @return the node representing the virtual invoke or null if not instanciated from a virtual invoke.
 */
public InvokeNode getVirtualNode(){
  if (this.instantiatedFrom != null)   return this.instantiatedFrom;
 else   return this;
}

Fixed version (ground truth):
/** 
 * If this is the implementation of a virtual/interface invoke instruction, return the InvokeNode for the virtual invoke instruction. TODO: This can be removed, if we ever remove   {@link ControlFlowGraph#resolveVirtualInvokes()}
 * @return the node representing the virtual invoke or null if not instantiated from a virtual invoke.
 */
public InvokeNode getVirtualNode(){
  if (this.instantiatedFrom != null)   return this.instantiatedFrom;
 else   return this;
}
Program: 186551
Project: 186551
Buggy source:
@Override public boolean visitNode(ExecutionContext context){
  MethodInfo method=context.getMethodInfo();
  MethodCode code=method.getCode();
  long ec=getExecCount(method);
  if (ec == 0)   return false;
  ControlFlowGraph cfg=method.getCode().getControlFlowGraph(false);
  for (  CFGNode node : cfg.getGraph().vertexSet()) {
    if (node instanceof InvokeNode) {
      InvokeNode inv=(InvokeNode)node;
      long ef=getExecFrequency(method,node);
      if (!inv.isVirtual()) {
        addExecCount(inv.getImplementingMethod(),ec * ef);
      }
 else {
        for (        MethodInfo invokee : ((InvokeNode)node).getImplementingMethods()) {
          addExecCount(invokee,ec * ef);
        }
      }
    }
 else     if (node instanceof BasicBlockNode) {
      for (      InstructionHandle ih : node.getBasicBlock().getInstructions()) {
        if (!code.isInvokeSite(ih))         continue;
        long ef=getExecFrequency(method,node);
        for (        MethodInfo invokee : method.getAppInfo().findImplementations(code.getInvokeSite(ih))) {
          addExecCount(invokee,ec * ef);
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean visitNode(ExecutionContext context){
  MethodInfo method=context.getMethodInfo();
  MethodCode code=method.getCode();
  long ec=getExecCount(method);
  if (ec == 0)   return false;
  ControlFlowGraph cfg=method.getCode().getControlFlowGraph(false);
  for (  CFGNode node : cfg.getGraph().vertexSet()) {
    if (node instanceof InvokeNode) {
      InvokeNode inv=(InvokeNode)node;
      long ef=getExecFrequency(method,node);
      for (      MethodInfo invokee : inv.getImplementingMethods()) {
        addExecCount(invokee,ec * ef);
      }
    }
 else     if (node instanceof BasicBlockNode) {
      for (      InstructionHandle ih : node.getBasicBlock().getInstructions()) {
        if (!code.isInvokeSite(ih))         continue;
        long ef=getExecFrequency(method,node);
        for (        MethodInfo invokee : method.getAppInfo().findImplementations(code.getInvokeSite(ih))) {
          addExecCount(invokee,ec * ef);
        }
      }
    }
  }
  return true;
}
Program: 186553
Project: 186553
Buggy source:
@Override public Set<MethodInfo> updateChangeSet(ExecFrequencyProvider ecp,Set<MethodInfo> optimizedMethods,Set<MethodInfo> candidateChanges){
  Set<MethodInfo> changeSet=new HashSet<MethodInfo>(candidateChanges);
  changeSet.addAll(analyses.getExecFrequencyAnalysis().getChangeSet());
  changeSet.addAll(analyses.getMethodCacheAnalysis().getMissCountChangeSet(ecp));
  changeSet.addAll(analyses.getWCAInvoker().updateWCA(optimizedMethods));
  return changeSet;
}

Fixed version (ground truth):
@Override public Set<MethodInfo> updateChangeSet(ExecFrequencyProvider ecp,Set<MethodInfo> optimizedMethods,Set<MethodInfo> candidateChanges){
  Set<MethodInfo> changeSet=new HashSet<MethodInfo>(candidateChanges);
  changeSet.addAll(ecp.getChangeSet());
  changeSet.addAll(analyses.getMethodCacheAnalysis().getMissCountChangeSet(ecp));
  changeSet.addAll(analyses.getWCAInvoker().updateWCA(optimizedMethods));
  return changeSet;
}
Program: 186554
Project: 186554
Buggy source:
/** 
 * This merges the results for invokes and adds results for the virtual nodes. This is required if results for the virtual nodes are needed too, e.g. if  {@link ControlFlowGraph#getHandleNode(InstructionHandle)} is used.
 * @return the flow graph, including results for virtual blocks.
 */
public Map<CFGNode,Long> getNodeFlowVirtual(){
  Map<CFGNode,Long> flow=new HashMap<CFGNode,Long>(nodeFlow);
  for (  CFGNode node : nodeFlow.keySet()) {
    if (!(node instanceof InvokeNode))     continue;
    InvokeNode inv=(InvokeNode)node;
    InvokeNode virt=inv.getVirtualNode();
    if (virt != null) {
      Long val=flow.get(virt);
      if (val == null) {
        flow.put(virt,flow.get(inv));
      }
 else {
        flow.put(virt,flow.get(inv) + val);
      }
    }
  }
  return flow;
}

Fixed version (ground truth):
/** 
 * This merges the results for invokes and adds results for the virtual nodes. This is required if results for the virtual nodes are needed too, e.g. if  {@link ControlFlowGraph#getHandleNode(InstructionHandle)} is used.
 * @return the flow graph, including results for virtual blocks.
 */
public Map<CFGNode,Long> getNodeFlowVirtual(){
  Map<CFGNode,Long> flow=new HashMap<CFGNode,Long>(nodeFlow);
  for (  CFGNode node : nodeFlow.keySet()) {
    if (!(node instanceof InvokeNode))     continue;
    InvokeNode inv=(InvokeNode)node;
    if (!inv.isVirtualInstance())     continue;
    InvokeNode virt=inv.getVirtualNode();
    if (virt != null) {
      Long val=flow.get(virt);
      if (val == null) {
        flow.put(virt,flow.get(inv));
      }
 else {
        flow.put(virt,flow.get(inv) + val);
      }
    }
  }
  return flow;
}
Program: 186555
Project: 186555
Buggy source:
/** 
 * @param newHandles key is old handle, value is new handle
 */
public void copyResults(Map<InstructionHandle,InstructionHandle> newHandles){
  if (receivers != null) {
    receivers.copyResults(newHandles);
  }
  if (loopBounds != null) {
    loopBounds.copyResults(newHandles);
  }
}

Fixed version (ground truth):
/** 
 * @param method the method containing the new instructions
 * @param newHandles key is old handle, value is new handle. Value can be null.
 */
public void copyResults(MethodInfo method,Map<InstructionHandle,InstructionHandle> newHandles){
  if (receivers != null) {
    receivers.copyResults(method,newHandles);
  }
  if (loopBounds != null) {
    loopBounds.copyResults(method,newHandles);
  }
}
Program: 186556
Project: 186556
Buggy source:
@Override public void copyResults(Map<InstructionHandle,InstructionHandle> newHandles){
  for (  Map.Entry<InstructionHandle,InstructionHandle> entry : newHandles.entrySet()) {
    InstructionHandle oldHandle=entry.getKey();
    InstructionHandle newHandle=entry.getValue();
    if (newHandle == null)     continue;
    ContextMap<CallString,Set<String>> value=targets.get(oldHandle);
    if (value != null)     targets.put(newHandle,value);
  }
}

Fixed version (ground truth):
@Override public void copyResults(MethodInfo newContainer,Map<InstructionHandle,InstructionHandle> newHandles){
  for (  Map.Entry<InstructionHandle,InstructionHandle> entry : newHandles.entrySet()) {
    InstructionHandle oldHandle=entry.getKey();
    InstructionHandle newHandle=entry.getValue();
    if (newHandle == null)     continue;
    ContextMap<CallString,Set<String>> value=targets.get(oldHandle);
    if (value != null)     targets.put(newHandle,value.copy(newContainer));
  }
}
Program: 186558
Project: 186558
Buggy source:
@Override public void copyResults(Map<InstructionHandle,InstructionHandle> newHandles){
  throw new AppInfoError("String_Node_Str");
}

Fixed version (ground truth):
@Override public void copyResults(MethodInfo newContainer,Map<InstructionHandle,InstructionHandle> newHandles){
  throw new AppInfoError("String_Node_Str");
}
Program: 186559
Project: 186559
Buggy source:
/** 
 * Copy results to a new instruction handle.
 * @param newHandles keys are old handles, values are corresponding new handles
 */
void copyResults(Map<InstructionHandle,InstructionHandle> newHandles);

Fixed version (ground truth):
/** 
 * Copy results to a new instruction handle.
 * @param newContainer
 * @param newHandles keys are old handles, values are corresponding new handles
 */
void copyResults(MethodInfo newContainer,Map<InstructionHandle,InstructionHandle> newHandles);
Program: 186560
Project: 186560
Buggy source:
/** 
 * <p>Result Map: MethodInfo -> Instruction Offset -> Callstring -> R</p> <p>TODO: More efficient representations are possible</p>
 * @param result the result of the DFA analysis
 * @param serializer converter for the result domain (if not serializable), or nullif the results of type T should be serialized directly
 */
public static <T,R>AnalysisResultSerialization<R> fromContextMapResult(Map<InstructionHandle,ContextMap<CallString,T>> result,Serializer<T,R> serializer){
  AnalysisResultSerialization<R> analysisResult=new AnalysisResultSerialization<R>();
  for (  InstructionHandle instr : result.keySet()) {
    ContextMap<CallString,T> r=result.get(instr);
    Context c=r.getContext();
    for (    CallString cs : r.keySet()) {
      Integer position=instr.getPosition();
      if (serializer != null) {
        T rValue=r.get(cs);
        R sValue=serializer.serializedRepresentation(rValue);
        analysisResult.addResult(c.getMethodInfo(),position,cs,sValue);
      }
 else {
        analysisResult.addResult(c.getMethodInfo(),position,cs,(R)r.get(cs));
      }
    }
  }
  return analysisResult;
}

Fixed version (ground truth):
/** 
 * <p>Result Map: MethodInfo -> Instruction Offset -> Callstring -> R</p> <p>TODO: More efficient representations are possible</p>
 * @param result the result of the DFA analysis
 * @param serializer converter for the result domain (if not serializable), or nullif the results of type T should be serialized directly
 */
public static <T,R>AnalysisResultSerialization<R> fromContextMapResult(Map<InstructionHandle,ContextMap<CallString,T>> result,Serializer<T,R> serializer){
  AnalysisResultSerialization<R> analysisResult=new AnalysisResultSerialization<R>();
  for (  InstructionHandle instr : result.keySet()) {
    ContextMap<CallString,T> r=result.get(instr);
    Context c=r.getContext();
    InstructionList il=c.getMethodInfo().getCode().getInstructionList(true,false);
    for (    CallString cs : r.keySet()) {
      Integer position=instr.getPosition();
      if (position < 0)       continue;
      if (il.findHandle(position) != instr)       continue;
      if (serializer != null) {
        T rValue=r.get(cs);
        R sValue=serializer.serializedRepresentation(rValue);
        analysisResult.addResult(c.getMethodInfo(),position,cs,sValue);
      }
 else {
        analysisResult.addResult(c.getMethodInfo(),position,cs,(R)r.get(cs));
      }
    }
  }
  return analysisResult;
}
Program: 186561
Project: 186561
Buggy source:
private Map<InvokeSite,InvokeSite> insertInvokee(AnalysisManager analyses,CallString callString,InstructionList il,InstructionHandle next){
  MethodCode code=getMethod().getCode();
  MethodCode invokeeCode=invokee.getCode();
  InstructionList iList=invokeeCode.getInstructionList(true,false);
  Map<InstructionHandle,InstructionHandle> instrMap=new HashMap<InstructionHandle,InstructionHandle>();
  Map<InvokeSite,InvokeSite> invokeMap=new HashMap<InvokeSite,InvokeSite>();
  StacksizeAnalysis stacksize=analyses.getStacksizeAnalysis(invokee);
  for (InstructionHandle src=iList.getStart(); src != null; src=src.getNext()) {
    InstructionHandle ih=copyInstruction(code,stacksize,il,src,next);
    if (ih == null)     continue;
    code.copyCustomValues(invokee,ih,src);
    if (code.isInvokeSite(ih)) {
      InvokeSite newInvoke=code.getInvokeSite(ih);
      InvokeSite oldInvoke=invokeeCode.getInvokeSite(src);
      invokeMap.put(oldInvoke,newInvoke);
      setInlineCallString(code,ih,callString);
    }
    instrMap.put(src,ih);
  }
  remapTargets(instrMap,next);
  if (updateDFA) {
    jcopter.getDfaTool().copyResults(instrMap);
  }
  return invokeMap;
}

Fixed version (ground truth):
private Map<InvokeSite,InvokeSite> insertInvokee(AnalysisManager analyses,CallString callString,InstructionList il,InstructionHandle next){
  MethodCode code=getMethod().getCode();
  MethodCode invokeeCode=invokee.getCode();
  InstructionList iList=invokeeCode.getInstructionList(true,false);
  Map<InstructionHandle,InstructionHandle> instrMap=new HashMap<InstructionHandle,InstructionHandle>();
  Map<InvokeSite,InvokeSite> invokeMap=new HashMap<InvokeSite,InvokeSite>();
  StacksizeAnalysis stacksize=analyses.getStacksizeAnalysis(invokee);
  for (InstructionHandle src=iList.getStart(); src != null; src=src.getNext()) {
    InstructionHandle ih=copyInstruction(code,stacksize,il,src,next);
    if (ih == null)     continue;
    code.copyCustomValues(invokee,ih,src);
    if (code.isInvokeSite(ih)) {
      InvokeSite newInvoke=code.getInvokeSite(ih);
      InvokeSite oldInvoke=invokeeCode.getInvokeSite(src);
      invokeMap.put(oldInvoke,newInvoke);
      setInlineCallString(code,ih,callString);
    }
    instrMap.put(src,ih);
  }
  remapTargets(instrMap,next);
  if (updateDFA) {
    jcopter.getDfaTool().copyResults(invokeSite.getInvoker(),instrMap);
  }
  return invokeMap;
}
Program: 186562
Project: 186562
Buggy source:
public static void registerOptions(OptionGroup options){
  options.addOption(GREEDY_ORDER);
  options.addOption(TARGETS);
  options.addOption(USE_WCEP);
  options.addOption(USE_WCA_EXEC_COUNT);
  options.addOption(USE_FREQUENCY_ONLY);
  options.addOption(CACHE_ANALYSIS_TYPE);
  options.addOption(WCA_CACHE_APPROXIMATION);
  options.addOption(DUMP_TARGET_CALLGRAPH);
}

Fixed version (ground truth):
public static void registerOptions(OptionGroup options){
  options.addOption(GREEDY_ORDER);
  options.addOption(TARGETS);
  options.addOption(USE_WCEP);
  options.addOption(USE_WCA_EXEC_COUNT);
  options.addOption(USE_FREQUENCY_ONLY);
  options.addOption(CACHE_ANALYSIS_TYPE);
  options.addOption(WCA_CACHE_APPROXIMATION);
  options.addOption(DUMP_TARGET_CALLGRAPH);
  options.addOption(MAX_STEPS);
}
Program: 186564
Project: 186564
Buggy source:
private void resetCounters(){
  countCandidates=0;
  countOptimized=0;
}

Fixed version (ground truth):
private void resetCounters(){
  countCandidates=0;
  countOptimized=0;
  maxSteps=config.getMaxSteps();
}
Program: 186566
Project: 186566
Buggy source:
@Override public void copyResults(Map<InstructionHandle,InstructionHandle> newHandles){
  for (  Map.Entry<InstructionHandle,InstructionHandle> entry : newHandles.entrySet()) {
    InstructionHandle oldHandle=entry.getKey();
    InstructionHandle newHandle=entry.getValue();
    ContextMap<CallString,Set<String>> value=targets.get(oldHandle);
    if (value != null)     targets.put(newHandle,value);
  }
}

Fixed version (ground truth):
@Override public void copyResults(Map<InstructionHandle,InstructionHandle> newHandles){
  for (  Map.Entry<InstructionHandle,InstructionHandle> entry : newHandles.entrySet()) {
    InstructionHandle oldHandle=entry.getKey();
    InstructionHandle newHandle=entry.getValue();
    if (newHandle == null)     continue;
    ContextMap<CallString,Set<String>> value=targets.get(oldHandle);
    if (value != null)     targets.put(newHandle,value);
  }
}
Program: 186568
Project: 186568
Buggy source:
public void setUpdateDFA(boolean updateDFA){
  this.updateDFA=updateDFA && appInfo.getCallstringLength() == 0;
}

Fixed version (ground truth):
public void setUpdateDFA(boolean updateDFA){
  if (updateDFA && appInfo.getCallstringLength() != 0) {
    logger.warn("String_Node_Str");
  }
  this.updateDFA=updateDFA && appInfo.getCallstringLength() == 0;
}
Program: 186569
Project: 186569
Buggy source:
public Set<InvokeSite> getInvokeSites(MethodInfo invokee){
  MethodNode node=getMethodNode(invokee);
  Set<InvokeSite> invokeSites=new HashSet<InvokeSite>();
  for (  ExecutionContext ec : node.getInstances()) {
    if (ec.getCallString().isEmpty()) {
      AppInfo appInfo=AppInfo.getSingleton();
      for (      ContextEdge edge : callGraph.incomingEdgesOf(ec)) {
        for (        InvokeSite invokeSite : edge.getSource().getMethodInfo().getCode().getInvokeSites()) {
          if (invokeSite.canInvoke(invokee) == Ternary.TRUE) {
            invokeSites.add(invokeSite);
          }
        }
      }
    }
 else {
      invokeSites.add(ec.getCallString().top());
    }
  }
  return invokeSites;
}

Fixed version (ground truth):
public Set<InvokeSite> getInvokeSites(MethodInfo invokee){
  MethodNode node=getMethodNode(invokee);
  Set<InvokeSite> invokeSites=new HashSet<InvokeSite>();
  for (  ExecutionContext ec : node.getInstances()) {
    if (ec.getCallString().isEmpty()) {
      AppInfo appInfo=AppInfo.getSingleton();
      for (      ContextEdge edge : callGraph.incomingEdgesOf(ec)) {
        for (        InvokeSite invokeSite : edge.getSource().getMethodInfo().getCode().getInvokeSites()) {
          if (invokeSite.canInvoke(invokee) != Ternary.FALSE) {
            invokeSites.add(invokeSite);
          }
        }
      }
    }
 else {
      invokeSites.add(ec.getCallString().top());
    }
  }
  return invokeSites;
}