nus-yam/ex-repair huggingface dataset:
Program: 30353
Project: 30353
Buggy source:
@Override public void propertyChange(PropertyChangeEvent e){
  Element a=(Element)e.getNewValue();
  ChapterDocument doc=Ctx.project.getSelectedChapter();
  faList.addElements(doc,a,"String_Node_Str");
  verbList.addElements(doc,a,"String_Node_Str");
  dialogList.addElements(doc,a,"String_Node_Str");
  soundList.addElements(doc,a,"String_Node_Str");
  props.setActorDocument(doc,a);
  String selTitle=tabPanel.getSelectedIndex() == -1 ? null : tabPanel.getTitleAt(tabPanel.getSelectedIndex());
  tabPanel.clear();
  if (a != null) {
    String type=doc.getType(a);
    if (!type.equals(ChapterDocument.NO_RENDERER_ACTOR_TYPE))     tabPanel.addTab("String_Node_Str",faList);
    if (!type.equals("String_Node_Str")) {
      tabPanel.addTab("String_Node_Str",verbList);
      tabPanel.addTab("String_Node_Str",soundList);
    }
    tabPanel.addTab("String_Node_Str",dialogList);
    tabPanel.addTab("String_Node_Str",props);
    setTile("String_Node_Str" + doc.getId(a));
    if (selTitle != null) {
      for (int i=0; i < tabPanel.getTabCount(); i++) {
        if (tabPanel.getTitleAt(i).equals(selTitle)) {
          tabPanel.setTab(i);
        }
      }
    }
  }
 else {
    setTile("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent e){
  Element a=(Element)e.getNewValue();
  ChapterDocument doc=Ctx.project.getSelectedChapter();
  String selTitle=tabPanel.getSelectedIndex() == -1 ? null : tabPanel.getTitleAt(tabPanel.getSelectedIndex());
  tabPanel.clear();
  if (a != null) {
    String type=doc.getType(a);
    if (!type.equals(ChapterDocument.NO_RENDERER_ACTOR_TYPE))     tabPanel.addTab("String_Node_Str",faList);
    if (!type.equals("String_Node_Str")) {
      tabPanel.addTab("String_Node_Str",verbList);
      tabPanel.addTab("String_Node_Str",soundList);
    }
    tabPanel.addTab("String_Node_Str",dialogList);
    tabPanel.addTab("String_Node_Str",props);
    setTile("String_Node_Str" + doc.getId(a));
    if (selTitle != null) {
      for (int i=0; i < tabPanel.getTabCount(); i++) {
        if (tabPanel.getTitleAt(i).equals(selTitle)) {
          tabPanel.setTab(i);
        }
      }
    }
  }
 else {
    setTile("String_Node_Str");
  }
  faList.addElements(doc,a,"String_Node_Str");
  verbList.addElements(doc,a,"String_Node_Str");
  dialogList.addElements(doc,a,"String_Node_Str");
  soundList.addElements(doc,a,"String_Node_Str");
  props.setActorDocument(doc,a);
}
Program: 30354
Project: 30354
Buggy source:
@Override public void create(){
  Node sel=tree.getSelection().getLastSelected();
  Element parent=dialog;
  if (sel != null) {
    parent=(Element)sel.getParent().getObject();
  }
  EditDialogOptionDialog o=new EditDialogOptionDialog(skin,doc,parent,null);
  o.show(getStage());
  o.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      Node sel=tree.getSelection().getLastSelected();
      Element e=((EditElementDialog)actor).getElement();
      Node n=createNode(e);
      if (sel != null) {
        sel.add(n);
      }
 else {
        tree.add(n);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void create(){
  Element parent=dialog;
  if (!tree.getSelection().isEmpty()) {
    Node sel=tree.getSelection().getLastSelected();
    parent=(Element)sel.getParent().getObject();
  }
  EditDialogOptionDialog o=new EditDialogOptionDialog(skin,doc,parent,null);
  o.show(getStage());
  o.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      Node sel=tree.getSelection().getLastSelected();
      Element e=((EditElementDialog)actor).getElement();
      Node n=createNode(e);
      if (sel != null) {
        sel.add(n);
      }
 else {
        tree.add(n);
      }
    }
  }
);
}
Program: 30355
Project: 30355
Buggy source:
public void layout(){
  final BitmapFont font=style.font;
  final Drawable selectedDrawable=style.selection;
  prefWidth=0;
  for (int i=0; i < items.size; i++) {
    TextBounds bounds=font.getBounds(cellRenderer.getCellTitle(items.get(i)));
    prefWidth=Math.max(bounds.width,prefWidth);
    if (cellRenderer.hasSubtitle()) {
      bounds=font.getBounds(cellRenderer.getCellSubTitle(items.get(i)));
      prefWidth=Math.max(bounds.width,prefWidth);
    }
    if (cellRenderer.hasImage()) {
      TextureRegion r=cellRenderer.getCellImage(items.get(i));
      float ih=r.getRegionHeight();
      float iw=r.getRegionWidth();
      if (ih > getItemHeight() - 10) {
        ih=getItemHeight() - 10;
        iw*=ih / r.getRegionHeight();
      }
      prefWidth=Math.max(iw,prefWidth);
    }
  }
  prefWidth+=selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
  prefHeight=items.size * cellRenderer.getItemHeight();
  Drawable background=style.background;
  if (background != null) {
    prefWidth+=background.getLeftWidth() + background.getRightWidth();
    prefHeight+=background.getTopHeight() + background.getBottomHeight();
  }
  cellRenderer.layout(style);
}

Fixed version (ground truth):
public void layout(){
  final BitmapFont font=style.font;
  final Drawable selectedDrawable=style.selection;
  cellRenderer.layout(style);
  prefWidth=0;
  for (int i=0; i < items.size; i++) {
    TextBounds bounds=font.getBounds(cellRenderer.getCellTitle(items.get(i)));
    prefWidth=Math.max(bounds.width,prefWidth);
    if (cellRenderer.hasSubtitle()) {
      bounds=font.getBounds(cellRenderer.getCellSubTitle(items.get(i)));
      prefWidth=Math.max(bounds.width,prefWidth);
    }
    if (cellRenderer.hasImage()) {
      TextureRegion r=cellRenderer.getCellImage(items.get(i));
      float ih=r.getRegionHeight();
      float iw=r.getRegionWidth();
      if (ih > getItemHeight() - 10) {
        ih=getItemHeight() - 10;
        iw*=ih / r.getRegionHeight();
      }
      prefWidth=Math.max(iw,prefWidth);
    }
  }
  prefWidth+=selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
  prefHeight=items.size * cellRenderer.getItemHeight();
  Drawable background=style.background;
  if (background != null) {
    prefWidth+=background.getLeftWidth() + background.getRightWidth();
    prefHeight+=background.getTopHeight() + background.getBottomHeight();
  }
}
Program: 30357
Project: 30357
Buggy source:
@Override public TextureRegion getCellImage(Element e){
  String iconName=MessageFormat.format("String_Node_Str",e.getAttribute("String_Node_Str"));
  TextureRegion image=null;
  image=Ctx.assetManager.getIcon(iconName);
  if (image == null)   image=Ctx.assetManager.getIcon("String_Node_Str");
  return image;
}

Fixed version (ground truth):
@Override public TextureRegion getCellImage(Element e){
  boolean custom=true;
  String verbName=e.getAttribute("String_Node_Str");
  for (  String v : VERBS) {
    if (v.equals(verbName)) {
      custom=false;
      break;
    }
  }
  String iconName=MessageFormat.format("String_Node_Str",e.getAttribute("String_Node_Str"));
  TextureRegion image=null;
  if (!custom)   image=Ctx.assetManager.getIcon(iconName);
 else   image=Ctx.assetManager.getIcon("String_Node_Str");
  return image;
}
Program: 30358
Project: 30358
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  down();
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex();
  if (pos == -1)   pos=0;
 else   pos++;
  Element e=((EditElementDialog)actor).getElement();
  list.getItems().insert(pos,e);
  int i=getItems().indexOf(e,true);
  if (i != -1)   list.setSelectedIndex(i);
  list.invalidateHierarchy();
}
Program: 30359
Project: 30359
Buggy source:
public EditList(Skin skin){
  super(skin);
  this.skin=skin;
  list=new CustomList<T>(skin);
  Array<T> items=new Array<T>();
  list.setItems(items);
  ScrollPane scrollPane=new ScrollPane(list,skin);
  container=new Container(scrollPane);
  container.fill();
  container.prefHeight(100);
  toolbar=new EditToolbar(skin);
  add(toolbar).expandX().fillX();
  row().fill();
  add(container).expandY().fill();
  toolbar.addCreateListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      create();
    }
  }
);
  toolbar.addEditListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      edit();
    }
  }
);
  toolbar.addDeleteListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      delete();
    }
  }
);
  toolbar.addCopyListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      copy();
    }
  }
);
  toolbar.addPasteListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      paste();
    }
  }
);
  list.addListener(new InputListener(){
    @Override public void enter(    InputEvent event,    float x,    float y,    int pointer,    com.badlogic.gdx.scenes.scene2d.Actor fromActor){
      EditorLogger.debug("String_Node_Str" + x + "String_Node_Str"+ y);
      getStage().setScrollFocus(list);
    }
  }
);
}

Fixed version (ground truth):
public EditList(Skin skin){
  super(skin);
  this.skin=skin;
  list=new CustomList<T>(skin);
  Array<T> items=new Array<T>();
  list.setItems(items);
  ScrollPane scrollPane=new ScrollPane(list,skin);
  container=new Container<ScrollPane>(scrollPane);
  container.fill();
  container.prefHeight(100);
  toolbar=new EditToolbar(skin);
  add(toolbar).expandX().fillX();
  row().fill();
  add(container).expandY().fill();
  toolbar.addCreateListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      create();
    }
  }
);
  toolbar.addEditListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      edit();
    }
  }
);
  toolbar.addDeleteListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      delete();
    }
  }
);
  toolbar.addCopyListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      copy();
    }
  }
);
  toolbar.addPasteListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      paste();
    }
  }
);
  list.addListener(new InputListener(){
    @Override public void enter(    InputEvent event,    float x,    float y,    int pointer,    com.badlogic.gdx.scenes.scene2d.Actor fromActor){
      EditorLogger.debug("String_Node_Str" + x + "String_Node_Str"+ y);
      getStage().setScrollFocus(list);
    }
  }
);
}
Program: 30360
Project: 30360
Buggy source:
@Override public float getWidth(){
  if (bounds != null && bounds.getWidth() != 0)   return bounds.getWidth();
  return 200;
}

Fixed version (ground truth):
@Override public float getWidth(){
  if (bounds != null && bounds.getWidth() > 0) {
    return bounds.getWidth();
  }
  return 200;
}
Program: 30361
Project: 30361
Buggy source:
@Override public float getHeight(){
  if (bounds != null && bounds.getWidth() != 0)   return bounds.getHeight();
  return 200;
}

Fixed version (ground truth):
@Override public float getHeight(){
  if (bounds != null && bounds.getHeight() > 0)   return bounds.getHeight();
  return 200;
}
Program: 30362
Project: 30362
Buggy source:
@Override public void draw(SpriteBatch batch,float x,float y,float scale){
  if (currentSkeleton != null && currentSkeleton.skeleton != null) {
    currentSkeleton.skeleton.setX(x / scale);
    currentSkeleton.skeleton.setY(y / scale);
    batch.setTransformMatrix(batch.getTransformMatrix().scale(scale,scale,1.0f));
    renderer.draw(batch,currentSkeleton.skeleton);
    batch.setTransformMatrix(batch.getTransformMatrix().scale(1 / scale,1 / scale,1.0f));
  }
 else {
    RectangleRenderer.draw(batch,x,y,getWidth() * scale,getHeight() * scale,Color.RED);
  }
}

Fixed version (ground truth):
@Override public void draw(SpriteBatch batch,float x,float y,float scale){
  if (currentSkeleton != null && currentSkeleton.skeleton != null) {
    currentSkeleton.skeleton.setX(x / scale);
    currentSkeleton.skeleton.setY(y / scale);
    batch.setTransformMatrix(batch.getTransformMatrix().scale(scale,scale,1.0f));
    renderer.draw(batch,currentSkeleton.skeleton);
    batch.setTransformMatrix(batch.getTransformMatrix().scale(1 / scale,1 / scale,1.0f));
  }
 else {
    x=x - getWidth() / 2 * scale;
    RectangleRenderer.draw(batch,x,y,getWidth() * scale,getHeight() * scale,Color.RED);
  }
}
Program: 30363
Project: 30363
Buggy source:
@Override protected void create(){
  EditElementDialog dialog=getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex();
      Element e2=null;
      pos++;
      if (pos != 0 && pos < list.getItems().size)       e2=list.getItems().get(pos);
      Element e=((EditElementDialog)actor).getElement();
      list.getItems().insert(pos,e);
      Node parent=e.getParentNode();
      parent.removeChild(e);
      parent.insertBefore(e,e2);
      int i=getItems().indexOf(e,true);
      if (i != -1)       list.setSelectedIndex(i);
      list.invalidateHierarchy();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void create(){
  EditElementDialog dialog=getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex() + 1;
      Element e2=null;
      if (pos != 0 && pos < list.getItems().size)       e2=list.getItems().get(pos);
      Element e=((EditElementDialog)actor).getElement();
      list.getItems().insert(pos,e);
      Node parent=e.getParentNode();
      parent.removeChild(e);
      parent.insertBefore(e,e2);
      list.setSelectedIndex(pos);
      list.invalidateHierarchy();
    }
  }
);
}
Program: 30364
Project: 30364
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex();
  Element e2=null;
  pos++;
  if (pos != 0 && pos < list.getItems().size)   e2=list.getItems().get(pos);
  Element e=((EditElementDialog)actor).getElement();
  list.getItems().insert(pos,e);
  Node parent=e.getParentNode();
  parent.removeChild(e);
  parent.insertBefore(e,e2);
  int i=getItems().indexOf(e,true);
  if (i != -1)   list.setSelectedIndex(i);
  list.invalidateHierarchy();
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex() + 1;
  Element e2=null;
  if (pos != 0 && pos < list.getItems().size)   e2=list.getItems().get(pos);
  Element e=((EditElementDialog)actor).getElement();
  list.getItems().insert(pos,e);
  Node parent=e.getParentNode();
  parent.removeChild(e);
  parent.insertBefore(e,e2);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
}
Program: 30365
Project: 30365
Buggy source:
@Override protected void paste(){
  Element newElement=doc.cloneNode(parent,clipboard);
  addItem(newElement);
  int i=getItems().indexOf(newElement,true);
  list.setSelectedIndex(i);
}

Fixed version (ground truth):
@Override protected void paste(){
  Element newElement=doc.cloneNode(parent,clipboard);
  int pos=list.getSelectedIndex() + 1;
  Element e2=null;
  if (pos != 0 && pos < list.getItems().size)   e2=list.getItems().get(pos);
  list.getItems().insert(pos,newElement);
  Node parent=newElement.getParentNode();
  parent.insertBefore(newElement,e2);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
}
Program: 30366
Project: 30366
Buggy source:
@Override public void dispose(){
  for (  String key : sourceCache.keySet()) {
    EngineAssetManager.getInstance().disposeAtlas(key);
  }
  sourceCache.clear();
  currentSource=null;
}

Fixed version (ground truth):
@Override public void dispose(){
  for (  ImageCacheEntry entry : sourceCache.values()) {
    EngineAssetManager.getInstance().disposeTexture(entry.tex);
  }
  sourceCache.clear();
  currentSource=null;
}
Program: 30368
Project: 30368
Buggy source:
@Override public void dispose(){
  for (  String key : sourceCache.keySet()) {
    EngineAssetManager.getInstance().disposeAtlas(key);
  }
  sourceCache.clear();
  currentSource=null;
}

Fixed version (ground truth):
@Override public void dispose(){
  for (  String key : sourceCache.keySet()) {
    disposeSource(key);
  }
  sourceCache.clear();
  currentSource=null;
}
Program: 30370
Project: 30370
Buggy source:
@Override protected void create(){
  EditElementDialog dialog=getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex();
      if (pos == -1)       pos=0;
 else       pos++;
      Element e=((EditElementDialog)actor).getElement();
      list.getItems().insert(pos,e);
      int i=getItems().indexOf(e,true);
      if (i != -1)       list.setSelectedIndex(i);
      list.invalidateHierarchy();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void create(){
  EditElementDialog dialog=getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex();
      Element e2=null;
      pos++;
      if (pos != 0 && pos < list.getItems().size)       e2=list.getItems().get(pos);
      Element e=((EditElementDialog)actor).getElement();
      list.getItems().insert(pos,e);
      Node parent=e.getParentNode();
      parent.removeChild(e);
      parent.insertBefore(e,e2);
      int i=getItems().indexOf(e,true);
      if (i != -1)       list.setSelectedIndex(i);
      list.invalidateHierarchy();
    }
  }
);
}
Program: 30371
Project: 30371
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex();
  if (pos == -1)   pos=0;
 else   pos++;
  Element e=((EditElementDialog)actor).getElement();
  list.getItems().insert(pos,e);
  int i=getItems().indexOf(e,true);
  if (i != -1)   list.setSelectedIndex(i);
  list.invalidateHierarchy();
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex();
  Element e2=null;
  pos++;
  if (pos != 0 && pos < list.getItems().size)   e2=list.getItems().get(pos);
  Element e=((EditElementDialog)actor).getElement();
  list.getItems().insert(pos,e);
  Node parent=e.getParentNode();
  parent.removeChild(e);
  parent.insertBefore(e,e2);
  int i=getItems().indexOf(e,true);
  if (i != -1)   list.setSelectedIndex(i);
  list.invalidateHierarchy();
}
Program: 30372
Project: 30372
Buggy source:
@Override public TextureRegion getCellImage(Element e){
  String iconName=MessageFormat.format("String_Node_Str",e.getAttribute("String_Node_Str"));
  TextureRegion image=null;
  try {
    image=Ctx.assetManager.getIcon(iconName);
  }
 catch (  GdxRuntimeException e1) {
    image=Ctx.assetManager.getIcon("String_Node_Str");
  }
  return image;
}

Fixed version (ground truth):
@Override public TextureRegion getCellImage(Element e){
  String iconName=MessageFormat.format("String_Node_Str",e.getAttribute("String_Node_Str"));
  TextureRegion image=null;
  image=Ctx.assetManager.getIcon(iconName);
  if (image == null)   image=Ctx.assetManager.getIcon("String_Node_Str");
  return image;
}
Program: 30373
Project: 30373
Buggy source:
public void addElements(BaseDocument doc,Element parent,String tag){
  this.doc=doc;
  this.parent=parent;
  list.getItems().clear();
  list.getSelection().clear();
  if (parent != null) {
    NodeList nl;
    if (tag == null)     nl=parent.getChildNodes();
 else {
      nl=doc.getChildrenByTag(parent,tag);
    }
    for (int i=0; i < nl.getLength(); i++) {
      if (nl.item(i) instanceof Element)       addItem((Element)nl.item(i));
    }
  }
  if (getItems().size > 0)   list.setSelectedIndex(0);
  toolbar.disableEdit(list.getSelectedIndex() < 0);
  if (sorted) {
    list.getItems().sort(new Comparator<Element>(){
      @Override public int compare(      Element o1,      Element o2){
        return o1.getAttribute("String_Node_Str").compareTo(o2.getAttribute("String_Node_Str"));
      }
    }
);
  }
  toolbar.disableCreate(parent == null);
  invalidateHierarchy();
}

Fixed version (ground truth):
public void addElements(BaseDocument doc,Element parent,String tag){
  this.doc=doc;
  this.parent=parent;
  list.getItems().clear();
  list.getSelection().clear();
  if (parent != null) {
    NodeList nl;
    if (tag == null)     nl=parent.getChildNodes();
 else {
      nl=doc.getChildrenByTag(parent,tag);
    }
    for (int i=0; i < nl.getLength(); i++) {
      if (nl.item(i) instanceof Element)       addItem((Element)nl.item(i));
    }
  }
  if (getItems().size > 0)   list.setSelectedIndex(0);
  toolbar.disableEdit(list.getSelectedIndex() < 0);
  if (sorted) {
    list.getItems().sort(new Comparator<Element>(){
      @Override public int compare(      Element o1,      Element o2){
        return o1.getAttribute("String_Node_Str").compareTo(o2.getAttribute("String_Node_Str"));
      }
    }
);
  }
  toolbar.disableCreate(parent == null);
  list.invalidateHierarchy();
}
Program: 30374
Project: 30374
Buggy source:
public void removeActor(Actor a){
  Actor res=null;
  if (a.getId().equals(player)) {
    player=null;
  }
  res=actors.remove(a.getId());
  if (res == null)   fgActors.remove(a);
 else   dynamicActors.remove(a);
  if (a.isWalkObstacle() && polygonalNavGraph != null)   polygonalNavGraph.removeDinamicObstacle(a.getBBox());
}

Fixed version (ground truth):
public void removeActor(Actor a){
  if (a.getId().equals(player)) {
    player=null;
  }
  actors.remove(a.getId());
switch (a.getLayer()) {
case BACKGROUND:
    bgActors.remove(a);
  break;
case DYNAMIC:
dynamicActors.remove(a);
break;
case FOREGROUND:
fgActors.remove(a);
break;
}
if (a.isWalkObstacle() && polygonalNavGraph != null) polygonalNavGraph.removeDinamicObstacle(a.getBBox());
}
Program: 30375
Project: 30375
Buggy source:
private void init(){
  scenes=new HashMap<String,Scene>();
  inventory=new Inventory();
  textManager=new TextManager();
  timers=new Timers();
  cutMode=false;
  timeOfGame=0;
  customProperties=new HashMap<String,String>();
  spriteBatch=new SpriteBatch();
  disposed=false;
}

Fixed version (ground truth):
private void init(){
  scenes=new HashMap<String,Scene>();
  inventory=new Inventory();
  textManager=new TextManager();
  timers=new Timers();
  cutMode=false;
  timeOfGame=0;
  chapter=null;
  customProperties=new HashMap<String,String>();
  spriteBatch=new SpriteBatch();
  disposed=false;
}
Program: 30377
Project: 30377
Buggy source:
public Element cloneNode(Element e){
  Element cloned;
  if (e.getOwnerDocument() != doc) {
    cloned=(Element)doc.importNode(e,true);
  }
 else {
    cloned=(Element)e.cloneNode(true);
  }
  return cloned;
}

Fixed version (ground truth):
public Element cloneNode(Element parent,Element e){
  Element cloned;
  if (e.getOwnerDocument() != doc) {
    cloned=(Element)doc.importNode(e,true);
  }
 else {
    cloned=(Element)e.cloneNode(true);
  }
  parent.appendChild(cloned);
  if (cloned.getAttribute("String_Node_Str") != null && !cloned.getAttribute("String_Node_Str").isEmpty()) {
    cloned.setAttribute("String_Node_Str",getCheckedId(cloned,cloned.getAttribute("String_Node_Str")));
  }
  setModified(cloned);
  return cloned;
}
Program: 30378
Project: 30378
Buggy source:
/** 
 * Sets the element id avoiding duplicated ids
 * @param e
 * @param id
 */
public void setId(Element e,String id){
  String idChecked=id;
  if (e.getParentNode() instanceof Element) {
    NodeList nl=((Element)e.getParentNode()).getElementsByTagName(e.getTagName());
    boolean checked=false;
    int i=1;
    while (!checked) {
      checked=true;
      for (int j=0; j < nl.getLength(); j++) {
        Element e2=(Element)nl.item(j);
        if (e2.getAttribute("String_Node_Str").equals(idChecked) && e != e2) {
          i++;
          idChecked=id + i;
          checked=false;
          break;
        }
      }
    }
  }
  setRootAttr(e,"String_Node_Str",idChecked);
}

Fixed version (ground truth):
/** 
 * Sets the element id avoiding duplicated ids
 * @param e
 * @param id
 */
public void setId(Element e,String id){
  String idChecked=getCheckedId(e,id);
  setRootAttr(e,"String_Node_Str",idChecked);
}
Program: 30380
Project: 30380
Buggy source:
public void addElements(BaseDocument doc,Element parent,String tag){
  this.doc=doc;
  this.parent=parent;
  list.getItems().clear();
  list.getSelection().clear();
  ;
  if (parent != null) {
    NodeList nl;
    if (tag == null)     nl=parent.getChildNodes();
 else {
      nl=doc.getChildrenByTag(parent,tag);
    }
    for (int i=0; i < nl.getLength(); i++) {
      if (nl.item(i) instanceof Element)       addItem((Element)nl.item(i));
    }
  }
  if (getItems().size > 0)   list.setSelectedIndex(0);
  toolbar.disableEdit(list.getSelectedIndex() < 0);
  if (sorted) {
    list.getItems().sort(new Comparator<Element>(){
      @Override public int compare(      Element o1,      Element o2){
        return o1.getAttribute("String_Node_Str").compareTo(o2.getAttribute("String_Node_Str"));
      }
    }
);
  }
  toolbar.disableCreate(parent == null);
  invalidateHierarchy();
}

Fixed version (ground truth):
public void addElements(BaseDocument doc,Element parent,String tag){
  this.doc=doc;
  this.parent=parent;
  list.getItems().clear();
  list.getSelection().clear();
  if (parent != null) {
    NodeList nl;
    if (tag == null)     nl=parent.getChildNodes();
 else {
      nl=doc.getChildrenByTag(parent,tag);
    }
    for (int i=0; i < nl.getLength(); i++) {
      if (nl.item(i) instanceof Element)       addItem((Element)nl.item(i));
    }
  }
  if (getItems().size > 0)   list.setSelectedIndex(0);
  toolbar.disableEdit(list.getSelectedIndex() < 0);
  if (sorted) {
    list.getItems().sort(new Comparator<Element>(){
      @Override public int compare(      Element o1,      Element o2){
        return o1.getAttribute("String_Node_Str").compareTo(o2.getAttribute("String_Node_Str"));
      }
    }
);
  }
  toolbar.disableCreate(parent == null);
  invalidateHierarchy();
}
Program: 30381
Project: 30381
Buggy source:
@Override protected void paste(){
  Element newElement=doc.cloneNode(clipboard);
  parent.appendChild(newElement);
  if (newElement.getAttribute("String_Node_Str") != null && !newElement.getAttribute("String_Node_Str").isEmpty()) {
    doc.setId(newElement,newElement.getAttribute("String_Node_Str"));
  }
  addItem(newElement);
  int i=getItems().indexOf(newElement,true);
  list.setSelectedIndex(i);
}

Fixed version (ground truth):
@Override protected void paste(){
  Element newElement=doc.cloneNode(parent,clipboard);
  addItem(newElement);
  int i=getItems().indexOf(newElement,true);
  list.setSelectedIndex(i);
}
Program: 30382
Project: 30382
Buggy source:
@SuppressWarnings("String_Node_Str") public EditActionDialog(Skin skin,BaseDocument doc,Element parent,Element e){
  super(skin);
  String[] actions=ActionFactory.getActionList();
  Arrays.sort(actions);
  String[] actions2=new String[actions.length + 1];
  System.arraycopy(actions,0,actions2,0,actions.length);
  actions2[actions2.length - 1]="String_Node_Str";
  actionPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str",actions2);
  actorPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str");
  classPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str",true);
  customParams=new InputPanel(skin,"String_Node_Str","String_Node_Str");
  setAction();
  ((SelectBox<String>)actionPanel.getField()).addListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      setAction();
    }
  }
);
  if (e != null) {
    actionPanel.setText(e.getTagName());
    actorPanel.setText(e.getAttribute("String_Node_Str"));
    classPanel.setText(e.getAttribute("String_Node_Str"));
  }
  init(parameters,getAttrs(),doc,parent,"String_Node_Str",e);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public EditActionDialog(Skin skin,BaseDocument doc,Element parent,Element e){
  super(skin);
  String[] actions=ActionFactory.getActionList();
  Arrays.sort(actions);
  String[] actions2=new String[actions.length + 1];
  System.arraycopy(actions,0,actions2,0,actions.length);
  actions2[actions2.length - 1]="String_Node_Str";
  actionPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str",actions2);
  actorPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str");
  classPanel=new InputPanel(skin,"String_Node_Str","String_Node_Str",true);
  customParams=new InputPanel(skin,"String_Node_Str","String_Node_Str");
  setAction();
  ((SelectBox<String>)actionPanel.getField()).addListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      setAction();
    }
  }
);
  if (e != null) {
    actionPanel.setText(e.getTagName());
    actorPanel.setText(e.getAttribute("String_Node_Str"));
    classPanel.setText(e.getAttribute("String_Node_Str"));
  }
  if (e != null && !e.getAttribute("String_Node_Str").isEmpty()) {
    actionPanel.setText(e.getAttribute("String_Node_Str"));
    setAction();
  }
  init(parameters,getAttrs(),doc,parent,"String_Node_Str",e);
}
Program: 30383
Project: 30383
Buggy source:
@Override protected void fill(){
  String actor=actorPanel.getText().trim();
  NamedNodeMap attributes=e.getAttributes();
  int l=attributes.getLength();
  for (int i=0; i < l; i++)   e.removeAttribute(attributes.item(i).getLocalName());
  if (!actor.isEmpty())   e.setAttribute("String_Node_Str",actor);
  String id=actionPanel.getText();
  if (id.equals("String_Node_Str")) {
    e.setAttribute("String_Node_Str",classPanel.getText());
  }
 else {
    e.setAttribute("String_Node_Str",id);
    super.fill();
  }
}

Fixed version (ground truth):
@Override protected void fill(){
  String actor=actorPanel.getText().trim();
  while (e.getAttributes().getLength() > 0) {
    e.removeAttribute(e.getAttributes().item(0).getNodeName());
  }
  if (!actor.isEmpty())   e.setAttribute("String_Node_Str",actor);
  String id=actionPanel.getText();
  if (id.equals("String_Node_Str")) {
    e.setAttribute("String_Node_Str",classPanel.getText());
  }
 else {
    e.setAttribute("String_Node_Str",id);
    super.fill();
  }
}
Program: 30384
Project: 30384
Buggy source:
public void setDesc(String s){
  if (!freezeHotSpot) {
    desc=s;
    if (desc.charAt(0) == '@')     desc=I18N.getString(desc.substring(1));
  }
}

Fixed version (ground truth):
public void setDesc(String s){
  if (!freezeHotSpot) {
    desc=s;
    if (desc != null && desc.charAt(0) == '@')     desc=I18N.getString(desc.substring(1));
  }
}
Program: 30385
Project: 30385
Buggy source:
@Override public void resize(int width,int height){
  viewport.update(width,height,true);
  ui.getPointer().resize(width,height);
}

Fixed version (ground truth):
@Override public void resize(int width,int height){
  viewport.update(width,height,true);
}
Program: 30386
Project: 30386
Buggy source:
@Override public void resize(int width,int height){
  stage.getViewport().update(width,height,true);
  ui.getPointer().resize(width,height);
}

Fixed version (ground truth):
@Override public void resize(int width,int height){
  stage.getViewport().update(width,height,true);
}
Program: 30387
Project: 30387
Buggy source:
private void getInputUnproject(Viewport v,Vector2 out){
  out.set(Gdx.input.getX(),Gdx.input.getY());
  v.unproject(out);
  if (out.x >= v.getWorldWidth())   out.x=v.getWorldWidth() - 1;
 else   if (out.x < 0)   out.x=0;
  if (out.y >= v.getWorldHeight())   out.y=v.getWorldHeight() - 1;
 else   if (out.y < 0)   out.y=0;
}

Fixed version (ground truth):
private void getInputUnproject(Viewport v,Vector2 out){
  out.set(Gdx.input.getX(),Gdx.input.getY());
  v.unproject(out);
}
Program: 30388
Project: 30388
Buggy source:
public void getInputUnProject(Vector3 out){
  out.set(Gdx.input.getX(),Gdx.input.getY(),0);
  unproject(out);
  if (out.x >= viewportWidth)   out.x=viewportWidth - 1;
 else   if (out.x < 0)   out.x=0;
  if (out.y >= viewportHeight)   out.y=viewportHeight - 1;
 else   if (out.y < 0)   out.y=0;
}

Fixed version (ground truth):
public void getInputUnProject(Vector3 out){
  out.set(Gdx.input.getX(),Gdx.input.getY(),0);
  unproject(out);
}
Program: 30389
Project: 30389
Buggy source:
public void touchEvent(int type,float x,float y,int pointer,int button){
switch (type) {
case SceneInputProcessor.TOUCH_UP:
    if (draggedActor != null) {
      stopDragging((int)x,(int)y);
    }
 else     if (collapsedBbox.contains(x,y)) {
      if (collapsed)       collapse(false);
 else       collapse(true);
    }
 else     if (configBbox.contains(x,y)) {
      sceneScreen.showMenu();
    }
 else {
      Actor actor=getItemAt(x,y);
      if (actor != null) {
        sceneScreen.actorClick(actor,pointer == 1);
      }
 else {
        updateScroll(x,y);
      }
    }
  break;
case SceneInputProcessor.TOUCH_DOWN:
break;
case SceneInputProcessor.DRAG:
startDragging(x,y);
break;
}
}

Fixed version (ground truth):
public void touchEvent(int type,float x,float y,int pointer,int button){
switch (type) {
case SceneInputProcessor.TOUCH_UP:
    if (draggedActor != null) {
      stopDragging((int)x,(int)y);
    }
 else     if (collapsedBbox.contains(x,y)) {
      if (collapsed)       collapse(false);
 else       collapse(true);
    }
 else     if (configBbox.contains(x,y)) {
      sceneScreen.showMenu();
    }
 else {
      Actor actor=getItemAt(x,y);
      if (actor != null) {
        sceneScreen.actorClick(actor,button == 1);
      }
 else {
        updateScroll(x,y);
      }
    }
  break;
case SceneInputProcessor.TOUCH_DOWN:
break;
case SceneInputProcessor.DRAG:
startDragging(x,y);
break;
}
}
Program: 30391
Project: 30391
Buggy source:
@SuppressWarnings("String_Node_Str") public void setText(String text){
  if (field instanceof TextField)   ((TextField)field).setText(text);
 else   if (field instanceof SelectBox<?>)   ((SelectBox<String>)field).setSelected(text);
 else   if (field instanceof Vector2Panel)   ((Vector2Panel)field).setText(text);
 else   if (field instanceof DimPanel)   ((DimPanel)field).setText(text);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void setText(String text){
  if (field instanceof TextField)   ((TextField)field).setText(text);
 else   if (field instanceof SelectBox) {
    int idx=((SelectBox<String>)field).getItems().indexOf(text,false);
    if (idx != -1)     ((SelectBox<String>)field).setSelectedIndex(idx);
  }
 else   if (field instanceof Vector2Panel)   ((Vector2Panel)field).setText(text);
 else   if (field instanceof DimPanel)   ((DimPanel)field).setText(text);
}
Program: 30392
Project: 30392
Buggy source:
private void loadChapter(String id) throws ParserConfigurationException, SAXException, IOException {
  SAXParserFactory spf=SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser saxParser=spf.newSAXParser();
  ChapterXMLLoader parser=new ChapterXMLLoader();
  XMLReader xmlReader=saxParser.getXMLReader();
  xmlReader.setContentHandler(parser);
  xmlReader.parse(new InputSource(EngineAssetManager.getInstance().getModelFile(id + "String_Node_Str").read()));
  I18N.load(EngineAssetManager.MODEL_DIR + "String_Node_Str",EngineAssetManager.MODEL_DIR + id);
  scenes=parser.getScenes();
  initScene=parser.getInitScene();
}

Fixed version (ground truth):
private void loadChapter(String id) throws ParserConfigurationException, SAXException, IOException {
  SAXParserFactory spf=SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser saxParser=spf.newSAXParser();
  ChapterXMLLoader parser=new ChapterXMLLoader();
  XMLReader xmlReader=saxParser.getXMLReader();
  xmlReader.setContentHandler(parser);
  xmlReader.parse(new InputSource(EngineAssetManager.getInstance().getModelFile(id + "String_Node_Str").read()));
  I18N.load(EngineAssetManager.MODEL_DIR + "String_Node_Str",EngineAssetManager.MODEL_DIR + id);
  scenes=parser.getScenes();
  initScene=parser.getInitScene();
  if (initScene == null && scenes.size() > 0)   initScene=scenes.get(0).getId();
}
Program: 30393
Project: 30393
Buggy source:
private AtlasFrameAnimation getFrameAnimation(String id){
  AtlasFrameAnimation fa=(AtlasFrameAnimation)fanims.get(id);
  flipX=false;
  if (fa == null && id != null) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=(AtlasFrameAnimation)fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.length() - 4));
        sb.append("String_Node_Str");
      }
 else       if (id.endsWith(FrameAnimation.FRONTLEFT)) {
        sb.append(id.substring(0,id.length() - 9));
        sb.append("String_Node_Str");
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.length() - 5));
        sb.append("String_Node_Str");
      }
 else       if (id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.length() - 10));
        sb.append("String_Node_Str");
      }
      String s=sb.toString();
      fa=(AtlasFrameAnimation)fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=(AtlasFrameAnimation)fanims.get(flipId);
        if (fa != null)         flipX=true;
      }
    }
  }
  return fa;
}

Fixed version (ground truth):
private AtlasFrameAnimation getFrameAnimation(String id){
  FrameAnimation fa=fanims.get(id);
  flipX=false;
  if (fa == null) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.FRONTLEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.LEFT);
      }
 else       if (id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.RIGHT);
      }
 else       if (id.endsWith(FrameAnimation.BACKLEFT) || id.endsWith(FrameAnimation.BACKRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.BACK);
      }
 else       if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTLEFT);
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTRIGHT);
      }
      String s=sb.toString();
      fa=fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=fanims.get(flipId);
        if (fa != null)         flipX=true;
      }
    }
  }
  return (AtlasFrameAnimation)fa;
}
Program: 30394
Project: 30394
Buggy source:
@Override public void update(float delta){
  if (currentSkeleton != null && currentSkeleton.skeleton != null) {
    currentSkeleton.animation.update(delta);
    currentSkeleton.animation.apply(currentSkeleton.skeleton);
    currentSkeleton.skeleton.updateWorldTransform();
    bounds.update(currentSkeleton.skeleton,true);
  }
}

Fixed version (ground truth):
@Override public void update(float delta){
  if (currentSkeleton != null && currentSkeleton.skeleton != null) {
    currentSkeleton.skeleton.update(delta);
    currentSkeleton.animation.update(delta);
    currentSkeleton.animation.apply(currentSkeleton.skeleton);
    currentSkeleton.skeleton.updateWorldTransform();
    bounds.update(currentSkeleton.skeleton,true);
  }
}
Program: 30395
Project: 30395
Buggy source:
private FrameAnimation getFrameAnimation(String id){
  FrameAnimation fa=fanims.get(id);
  flipX=false;
  if (fa == null) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.FRONTLEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.LEFT);
      }
 else       if (id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.RIGHT);
      }
 else       if (id.endsWith(FrameAnimation.BACKLEFT) || id.endsWith(FrameAnimation.BACKRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.BACK);
      }
 else       if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTLEFT);
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTRIGHT);
      }
      String s=sb.toString();
      fa=fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=fanims.get(flipId);
        if (fa != null)         flipX=true;
      }
    }
  }
  return fa;
}

Fixed version (ground truth):
private FrameAnimation getFrameAnimation(String id){
  FrameAnimation fa=fanims.get(id);
  flipX=false;
  if (fa == null) {
    String flipId=FrameAnimation.getFlipId(id);
    fa=fanims.get(flipId);
    if (fa != null)     flipX=true;
 else {
      StringBuilder sb=new StringBuilder();
      if (id.endsWith(FrameAnimation.FRONTLEFT) || id.endsWith(FrameAnimation.FRONTRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONT);
      }
 else       if (id.endsWith(FrameAnimation.BACKLEFT) || id.endsWith(FrameAnimation.BACKRIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.BACK);
      }
 else       if (id.endsWith(FrameAnimation.LEFT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTLEFT);
      }
 else       if (id.endsWith(FrameAnimation.RIGHT)) {
        sb.append(id.substring(0,id.lastIndexOf('.') + 1));
        sb.append(FrameAnimation.FRONTRIGHT);
      }
      String s=sb.toString();
      fa=fanims.get(s);
      if (fa == null) {
        flipId=FrameAnimation.getFlipId(s);
        fa=fanims.get(flipId);
        if (fa != null)         flipX=true;
      }
    }
  }
  return fa;
}
Program: 30396
Project: 30396
Buggy source:
private void retrieveSource(String source){
  SkeletonCacheEntry entry=skeletonCache.get(source);
  if (entry == null || entry.refCounter < 1) {
    loadSource(source);
    EngineAssetManager.getInstance().getManager().finishLoading();
    entry=skeletonCache.get(source);
  }
  if (entry.skeleton == null) {
    TextureAtlas atlas=EngineAssetManager.getInstance().getTextureAtlas(source);
    SkeletonBinary skel=new SkeletonBinary(atlas);
    SkeletonData skeletonData=skel.readSkeletonData(EngineAssetManager.getInstance().getSpine(source));
    entry.skeleton=new Skeleton(skeletonData);
    AnimationStateData stateData=new AnimationStateData(skeletonData);
    stateData.setDefaultMix(0);
    entry.animation=new AnimationState(stateData);
    entry.animation.addListener(animationListener);
  }
}

Fixed version (ground truth):
private void retrieveSource(String source){
  SkeletonCacheEntry entry=skeletonCache.get(source);
  if (entry == null || entry.refCounter < 1) {
    loadSource(source);
    EngineAssetManager.getInstance().getManager().finishLoading();
    entry=skeletonCache.get(source);
  }
  if (entry.skeleton == null) {
    TextureAtlas atlas=EngineAssetManager.getInstance().getTextureAtlas(source);
    SkeletonBinary skel=new SkeletonBinary(atlas);
    SkeletonData skeletonData=skel.readSkeletonData(EngineAssetManager.getInstance().getSpine(source));
    entry.skeleton=new Skeleton(skeletonData);
    AnimationStateData stateData=new AnimationStateData(skeletonData);
    stateData.setDefaultMix(0f);
    entry.animation=new AnimationState(stateData);
    entry.animation.addListener(animationListener);
  }
}
Program: 30397
Project: 30397
Buggy source:
@Override public void startFrameAnimation(String id,int repeatType,int count,ActionCallback cb){
  FrameAnimation fa=getFrameAnimation(id);
  if (fa == null) {
    EngineLogger.error("String_Node_Str" + id);
    return;
  }
  if (currentFrameAnimation != null && currentFrameAnimation.disposeWhenPlayed)   disposeSource(currentFrameAnimation.source);
  currentFrameAnimation=fa;
  currentSkeleton=skeletonCache.get(fa.source);
  animationCb=cb;
  if (currentSkeleton == null || currentSkeleton.refCounter < 1) {
    loadSource(fa.source);
    EngineAssetManager.getInstance().getManager().finishLoading();
    retrieveSource(fa.source);
    currentSkeleton=skeletonCache.get(fa.source);
    if (currentSkeleton == null) {
      EngineLogger.error("String_Node_Str" + id);
      currentFrameAnimation=null;
      return;
    }
  }
  if (repeatType == Tween.FROM_FA) {
    currentAnimationType=currentFrameAnimation.animationType;
    currentCount=currentFrameAnimation.count;
  }
 else {
    currentCount=count;
    currentAnimationType=repeatType;
  }
  currentSkeleton.skeleton.setFlipX(flipX);
  currentSkeleton.animation.setAnimation(0,fa.id,currentAnimationType == Tween.REPEAT);
}

Fixed version (ground truth):
@Override public void startFrameAnimation(String id,int repeatType,int count,ActionCallback cb){
  FrameAnimation fa=getFrameAnimation(id);
  if (fa == null) {
    EngineLogger.error("String_Node_Str" + id);
    return;
  }
  if (currentFrameAnimation != null && currentFrameAnimation.disposeWhenPlayed)   disposeSource(currentFrameAnimation.source);
  currentFrameAnimation=fa;
  currentSkeleton=skeletonCache.get(fa.source);
  animationCb=cb;
  if (currentSkeleton == null || currentSkeleton.refCounter < 1) {
    loadSource(fa.source);
    EngineAssetManager.getInstance().getManager().finishLoading();
    retrieveSource(fa.source);
    currentSkeleton=skeletonCache.get(fa.source);
    if (currentSkeleton == null) {
      EngineLogger.error("String_Node_Str" + id);
      currentFrameAnimation=null;
      return;
    }
  }
  if (repeatType == Tween.FROM_FA) {
    currentAnimationType=currentFrameAnimation.animationType;
    currentCount=currentFrameAnimation.count;
  }
 else {
    currentCount=count;
    currentAnimationType=repeatType;
  }
  currentSkeleton.skeleton.setFlipX(flipX);
  currentSkeleton.animation.setAnimation(0,fa.id,currentAnimationType == Tween.REPEAT);
  currentSkeleton.animation.setTimeScale(fa.duration);
  currentSkeleton.animation.apply(currentSkeleton.skeleton);
}
Program: 30398
Project: 30398
Buggy source:
@Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  scale=json.readValue("String_Node_Str",Float.class,jsonData);
  pos=json.readValue("String_Node_Str",Vector2.class,jsonData);
  float worldScale=EngineAssetManager.getInstance().getScale();
  pos.x*=worldScale;
  pos.y*=worldScale;
  walkingSpeed=json.readValue("String_Node_Str",Float.class,jsonData);
  posTween=json.readValue("String_Node_Str",Tween.class,jsonData);
  depthType=json.readValue("String_Node_Str",DepthType.class,jsonData);
  renderer=json.readValue("String_Node_Str",SpriteRenderer.class,jsonData);
}

Fixed version (ground truth):
@Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  scale=json.readValue("String_Node_Str",Float.class,jsonData);
  pos=json.readValue("String_Node_Str",Vector2.class,jsonData);
  float worldScale=EngineAssetManager.getInstance().getScale();
  pos.x*=worldScale;
  pos.y*=worldScale;
  walkingSpeed=json.readValue("String_Node_Str",Float.class,jsonData);
  posTween=json.readValue("String_Node_Str",Tween.class,jsonData);
  depthType=json.readValue("String_Node_Str",DepthType.class,jsonData);
  renderer=json.readValue("String_Node_Str",null,jsonData);
}