nus-yam/ex-repair huggingface dataset:
Program: 30154
Project: 30154
Buggy source:
@Override public boolean run(VerbRunner cb){
  SpriteActor a=(SpriteActor)World.getInstance().getCurrentScene().getActor(actor,true);
  SpriteAlphaTween t=new SpriteAlphaTween();
  t.start(a,repeat,count,alpha,speed,interpolation,wait ? cb : null);
  a.addTween(t);
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  SpriteActor a=(SpriteActor)w.getCurrentScene().getActor(actor,true);
  SpriteAlphaTween t=new SpriteAlphaTween();
  t.start(a,repeat,count,alpha,speed,interpolation,wait ? cb : null);
  a.addTween(t);
  return wait;
}
Program: 30155
Project: 30155
Buggy source:
@Override public boolean run(VerbRunner cb){
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)World.getInstance().getCurrentScene().getActor(actorId,true);
  String anim=animation.getAnimationId();
  if (keepDirection) {
    String c=((AnimationRenderer)a.getRenderer()).getCurrentAnimationId();
    if (anim.endsWith(AnimationRenderer.LEFT) && c.endsWith(AnimationRenderer.RIGHT) || anim.endsWith(AnimationRenderer.RIGHT) && c.endsWith(AnimationRenderer.LEFT)) {
      anim=AnimationRenderer.getFlipId(anim);
    }
  }
  a.startAnimation(anim,repeat,count,wait ? cb : null);
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)w.getCurrentScene().getActor(actorId,true);
  String anim=animation.getAnimationId();
  if (keepDirection) {
    String c=((AnimationRenderer)a.getRenderer()).getCurrentAnimationId();
    if (anim.endsWith(AnimationRenderer.LEFT) && c.endsWith(AnimationRenderer.RIGHT) || anim.endsWith(AnimationRenderer.RIGHT) && c.endsWith(AnimationRenderer.LEFT)) {
      anim=AnimationRenderer.getFlipId(anim);
    }
  }
  a.startAnimation(anim,repeat,count,wait ? cb : null);
  return wait;
}
Program: 30156
Project: 30156
Buggy source:
@Override public boolean run(VerbRunner cb){
  Vector2 pos2=null;
  Float zoom2=zoom;
  if (pos != null)   pos2=new Vector2(pos);
  float scale=EngineAssetManager.getInstance().getScale();
  SceneCamera camera=World.getInstance().getSceneCamera();
  if (zoom2 == null || zoom2 < 0)   zoom2=camera.getZoom();
  if (pos == null && target == null) {
    pos2=new Vector2(camera.getPosition());
    pos2.x/=scale;
    pos2.y/=scale;
  }
  if (target != null) {
    BaseActor target=World.getInstance().getCurrentScene().getActor(this.target,false);
    float x=target.getX();
    float y=target.getY();
    if (target instanceof InteractiveActor) {
      Vector2 refPoint=((InteractiveActor)target).getRefPoint();
      x+=refPoint.x;
      y+=refPoint.y;
    }
    if (pos2 != null) {
      pos2.x+=x;
      pos2.y+=y;
    }
 else {
      pos2=new Vector2(x,y);
    }
  }
  if (followActor != null) {
    if (followActor.equals("String_Node_Str"))     World.getInstance().getCurrentScene().setCameraFollowActor(null);
 else {
      World.getInstance().getCurrentScene().setCameraFollowActor((SpriteActor)World.getInstance().getCurrentScene().getActor(followActor,false));
    }
  }
  if (duration == null || duration == 0) {
    camera.setZoom(zoom2);
    camera.setPosition(pos2.x * scale,pos2.y * scale);
    return false;
  }
 else {
    camera.startAnimation(pos2.x * scale,pos2.y * scale,zoom2,duration,interpolation,wait ? cb : null);
  }
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  Vector2 pos2=null;
  Float zoom2=zoom;
  if (pos != null)   pos2=new Vector2(pos);
  float scale=EngineAssetManager.getInstance().getScale();
  SceneCamera camera=w.getSceneCamera();
  if (zoom2 == null || zoom2 < 0)   zoom2=camera.getZoom();
  if (pos == null && target == null) {
    pos2=new Vector2(camera.getPosition());
    pos2.x/=scale;
    pos2.y/=scale;
  }
  if (target != null) {
    BaseActor target=w.getCurrentScene().getActor(this.target,false);
    float x=target.getX();
    float y=target.getY();
    if (target instanceof InteractiveActor) {
      Vector2 refPoint=((InteractiveActor)target).getRefPoint();
      x+=refPoint.x;
      y+=refPoint.y;
    }
    if (pos2 != null) {
      pos2.x+=x;
      pos2.y+=y;
    }
 else {
      pos2=new Vector2(x,y);
    }
  }
  if (followActor != null) {
    if (followActor.equals("String_Node_Str"))     w.getCurrentScene().setCameraFollowActor(null);
 else {
      w.getCurrentScene().setCameraFollowActor((SpriteActor)w.getCurrentScene().getActor(followActor,false));
    }
  }
  if (duration == null || duration == 0) {
    camera.setZoom(zoom2);
    camera.setPosition(pos2.x * scale,pos2.y * scale);
    return false;
  }
 else {
    camera.startAnimation(pos2.x * scale,pos2.y * scale,zoom2,duration,interpolation,wait ? cb : null);
  }
  return wait;
}
Program: 30157
Project: 30157
Buggy source:
@Override public boolean run(VerbRunner cb){
  VerbRunner v=null;
  if (verb == null) {
    v=(VerbRunner)cb;
  }
  if (v == null && actor != null) {
    BaseActor a=World.getInstance().getCurrentScene().getActor(actor,true);
    v=((InteractiveActor)a).getVerb(verb,target);
  }
  if (v == null) {
    v=World.getInstance().getCurrentScene().getVerb(verb);
  }
  if (v == null) {
    v=World.getInstance().getVerbManager().getVerb(verb,null,null);
  }
  if (v != null) {
    v.cancel();
    World.getInstance().getCurrentScene().getTimers().removeTimerWithCb(v);
  }
 else   EngineLogger.error("String_Node_Str" + verb + "String_Node_Str"+ actor);
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  VerbRunner v=null;
  if (verb == null) {
    v=(VerbRunner)cb;
  }
  if (v == null && actor != null) {
    BaseActor a=w.getCurrentScene().getActor(actor,true);
    v=((InteractiveActor)a).getVerb(verb,target);
  }
  if (v == null) {
    v=w.getCurrentScene().getVerb(verb);
  }
  if (v == null) {
    v=w.getVerbManager().getVerb(verb,null,null);
  }
  if (v != null) {
    v.cancel();
    w.getCurrentScene().getTimers().removeTimerWithCb(v);
  }
 else   EngineLogger.error("String_Node_Str" + verb + "String_Node_Str"+ actor);
  return false;
}
Program: 30158
Project: 30158
Buggy source:
@Override public boolean run(VerbRunner cb){
  if (EngineLogger.debugMode() && comment != null) {
    EngineLogger.debug(comment);
    if (debug)     World.getInstance().getCurrentScene().getTextManager().addText(comment,TextManager.POS_SUBTITLE,TextManager.POS_SUBTITLE,false,Text.Type.UI,Color.YELLOW,null,null,null,null);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  if (EngineLogger.debugMode() && comment != null) {
    EngineLogger.debug(comment);
    if (debug)     w.getCurrentScene().getTextManager().addText(comment,TextManager.POS_SUBTITLE,TextManager.POS_SUBTITLE,false,Text.Type.UI,Color.YELLOW,null,null,null,null);
  }
  return false;
}
Program: 30159
Project: 30159
Buggy source:
public Action getAction(){
  if (action == null) {
    Json json=new Json();
    JsonValue root=new JsonReader().parse(serializedAction);
    action=ActionUtils.readJson(json,root);
  }
  return action;
}

Fixed version (ground truth):
public Action getAction(){
  if (action == null) {
    Json json=new Json();
    JsonValue root=new JsonReader().parse(serializedAction);
    action=ActionUtils.readJson(w,json,root);
  }
  return action;
}
Program: 30160
Project: 30160
Buggy source:
private void removeActor(Scene ts,BaseActor a){
  final World w=World.getInstance();
  float scale=EngineAssetManager.getInstance().getScale();
  w.getInventory().removeItem(a.getId());
  if (ts != w.getCurrentScene() && w.getCachedScene(ts.getId()) == null && a instanceof Disposable)   ((Disposable)a).dispose();
  ts.addActor(a);
  if (pos != null)   a.setPosition(pos.x * scale,pos.y * scale);
}

Fixed version (ground truth):
private void removeActor(Scene ts,BaseActor a){
  float scale=EngineAssetManager.getInstance().getScale();
  w.getInventory().removeItem(a.getId());
  if (ts != w.getCurrentScene() && w.getCachedScene(ts.getId()) == null && a instanceof Disposable)   ((Disposable)a).dispose();
  ts.addActor(a);
  if (pos != null)   a.setPosition(pos.x * scale,pos.y * scale);
}
Program: 30161
Project: 30161
Buggy source:
@Override public boolean run(VerbRunner cb){
  Scene ts=null;
  if (scene == null)   ts=World.getInstance().getCurrentScene();
 else   ts=World.getInstance().getScene(scene);
  BaseActor a;
  if (actor != null) {
    a=World.getInstance().getInventory().get(actor);
    if (a == null) {
      EngineLogger.error(MessageFormat.format("String_Node_Str",actor));
      return false;
    }
    removeActor(ts,a);
  }
 else {
    int n=World.getInstance().getInventory().getNumItems();
    for (int i=n - 1; i >= 0; i--) {
      a=World.getInstance().getInventory().get(i);
      removeActor(ts,a);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  Scene ts=null;
  if (scene == null)   ts=w.getCurrentScene();
 else   ts=w.getScene(scene);
  BaseActor a;
  if (actor != null) {
    a=w.getInventory().get(actor);
    if (a == null) {
      EngineLogger.error(MessageFormat.format("String_Node_Str",actor));
      return false;
    }
    removeActor(ts,a);
  }
 else {
    int n=w.getInventory().getNumItems();
    for (int i=n - 1; i >= 0; i--) {
      a=w.getInventory().get(i);
      removeActor(ts,a);
    }
  }
  return false;
}
Program: 30162
Project: 30162
Buggy source:
public void setVariable(String name,String value) throws Exception {
  if (story.getVariablesState().get(name) instanceof InkList) {
    InkList rawList=(InkList)story.getVariablesState().get(name);
    if (rawList.getOrigins() == null) {
      List<String> names=rawList.getOriginNames();
      if (names != null) {
        ArrayList<ListDefinition> origins=new ArrayList<ListDefinition>();
        for (        String n : names) {
          ListDefinition def=story.getListDefinitions().getDefinition(n);
          if (!origins.contains(def))           origins.add(def);
        }
        rawList.setOrigins(origins);
      }
    }
    rawList.addItem(value);
  }
 else   story.getVariablesState().set(name,value);
}

Fixed version (ground truth):
public synchronized void setVariable(String name,String value) throws Exception {
  if (story.getVariablesState().get(name) instanceof InkList) {
    InkList rawList=(InkList)story.getVariablesState().get(name);
    if (rawList.getOrigins() == null) {
      List<String> names=rawList.getOriginNames();
      if (names != null) {
        ArrayList<ListDefinition> origins=new ArrayList<ListDefinition>();
        for (        String n : names) {
          ListDefinition def=story.getListDefinitions().getDefinition(n);
          if (!origins.contains(def))           origins.add(def);
        }
        rawList.setOrigins(origins);
      }
    }
    rawList.addItem(value);
  }
 else   story.getVariablesState().set(name,value);
}
Program: 30163
Project: 30163
Buggy source:
public void cancel(){
  for (  Action c : actions) {
    if (c instanceof VerbRunner)     ((VerbRunner)c).cancel();
  }
  ip=actions.size() + 1;
  EngineLogger.debug("String_Node_Str" + id);
  if (cb != null)   cb.resume();
}

Fixed version (ground truth):
public void cancel(){
  ip=actions.size() + 1;
  for (  Action c : actions) {
    if (c instanceof VerbRunner)     ((VerbRunner)c).cancel();
  }
  if (cb != null) {
    ActionCallback cb2=cb;
    cb=null;
    cb2.resume();
  }
  EngineLogger.debug("String_Node_Str" + id);
}
Program: 30164
Project: 30164
Buggy source:
public void nextStep(){
  boolean stop=false;
  while (!isFinished() && !stop) {
    Action a=actions.get(ip);
    if (EngineLogger.debugMode())     EngineLogger.debug(ip + "String_Node_Str" + a.getClass().getSimpleName());
    try {
      if (a.run(this))       stop=true;
 else       ip++;
    }
 catch (    Exception e) {
      EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ e.getMessage(),e);
      ip++;
    }
  }
  if (ip == actions.size()) {
    EngineLogger.debug("String_Node_Str" + id);
    if (cb != null)     cb.resume();
  }
}

Fixed version (ground truth):
public void nextStep(){
  boolean stop=false;
  while (!isFinished() && !stop) {
    Action a=actions.get(ip);
    if (EngineLogger.debugMode())     EngineLogger.debug(ip + "String_Node_Str" + a.getClass().getSimpleName());
    try {
      if (a.run(this))       stop=true;
 else       ip++;
    }
 catch (    Exception e) {
      EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName() + "String_Node_Str"+ e.getMessage(),e);
      ip++;
    }
  }
  if (ip == actions.size()) {
    EngineLogger.debug("String_Node_Str" + id);
    if (cb != null) {
      ActionCallback cb2=cb;
      cb=null;
      cb2.resume();
    }
  }
}
Program: 30167
Project: 30167
Buggy source:
public boolean mouseMoved(InputEvent event,float x,float y){
  list.setSelectedIndex(Math.min(selectBox.items.size - 1,(int)((list.getHeight() - y) / list.getItemHeight())));
  return true;
}

Fixed version (ground truth):
public boolean mouseMoved(InputEvent event,float x,float y){
  list.setSelectedIndex(Math.min(list.getItems().size - 1,(int)((list.getHeight() - y) / list.getItemHeight())));
  return true;
}
Program: 30168
Project: 30168
Buggy source:
@Override public void write(Json json){
  json.writeValue("String_Node_Str",wasInCutmode);
  json.writeValue("String_Node_Str",ActionCallbackSerialization.find(cb));
  json.writeArrayStart("String_Node_Str");
  for (  Action a : actions) {
    ActionUtils.writeJson(a,json);
  }
  json.writeArrayEnd();
  json.writeValue("String_Node_Str",ip);
  json.writeArrayStart("String_Node_Str");
  for (  Action a : actions) {
    if (a instanceof Serializable) {
      json.writeObjectStart();
      ((Serializable)a).write(json);
      json.writeObjectEnd();
    }
  }
  json.writeArrayEnd();
  json.writeValue("String_Node_Str",storyName);
  if (story != null) {
    try {
      json.writeValue("String_Node_Str",story.getState().toJson());
    }
 catch (    Exception e) {
      EngineLogger.error(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
@Override public void write(Json json){
  json.writeValue("String_Node_Str",wasInCutmode);
  if (cb == null && sCb != null)   cb=ActionCallbackSerialization.find(sCb);
  json.writeValue("String_Node_Str",ActionCallbackSerialization.find(cb));
  json.writeArrayStart("String_Node_Str");
  for (  Action a : actions) {
    ActionUtils.writeJson(a,json);
  }
  json.writeArrayEnd();
  json.writeValue("String_Node_Str",ip);
  json.writeArrayStart("String_Node_Str");
  for (  Action a : actions) {
    if (a instanceof Serializable) {
      json.writeObjectStart();
      ((Serializable)a).write(json);
      json.writeObjectEnd();
    }
  }
  json.writeArrayEnd();
  json.writeValue("String_Node_Str",storyName);
  if (story != null) {
    try {
      json.writeValue("String_Node_Str",story.getState().toJson());
    }
 catch (    Exception e) {
      EngineLogger.error(e.getMessage(),e);
    }
  }
}
Program: 30169
Project: 30169
Buggy source:
public void bindExternalFunctions(InkManager ink) throws Exception {
  this.inkManager=ink;
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      try {
        World.getInstance().setModelProp(args[0].toString(),args[1].toString());
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + e.getMessage());
      }
      return null;
    }
  }
);
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      try {
        return World.getInstance().getModelProp(args[0].toString());
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + e.getMessage());
      }
      return null;
    }
  }
);
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      return World.getInstance().getInventory().get(args[0].toString()) != null;
    }
  }
);
}

Fixed version (ground truth):
public void bindExternalFunctions(InkManager ink) throws Exception {
  this.inkManager=ink;
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      try {
        World.getInstance().setModelProp(args[0].toString(),args[1].toString());
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + e.getMessage());
      }
      return null;
    }
  }
);
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      try {
        return World.getInstance().getModelProp(args[0].toString());
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + e.getMessage(),e);
      }
      return null;
    }
  }
);
  inkManager.getStory().bindExternalFunction("String_Node_Str",new ExternalFunction(){
    @Override public Object call(    Object[] args) throws Exception {
      return World.getInstance().getInventory().get(args[0].toString()) != null;
    }
  }
);
}
Program: 30171
Project: 30171
Buggy source:
public String getModelProp(String prop){
  return (String)getObjectWrapper().getValue(prop);
}

Fixed version (ground truth):
public String getModelProp(String prop){
  Object value=getObjectWrapper().getValue(prop);
  return value == null ? null : value.toString();
}
Program: 30172
Project: 30172
Buggy source:
public void takeScreenshot(String filename,int w){
  int h=(int)(w * getSceneCamera().viewportHeight / getSceneCamera().viewportWidth);
  GLFrameBuffer.FrameBufferBuilder frameBufferBuilder=new GLFrameBuffer.FrameBufferBuilder(w,h);
  frameBufferBuilder.addColorTextureAttachment(GL30.GL_RGB565,GL30.GL_RGB,GL30.GL_UNSIGNED_BYTE);
  FrameBuffer fbo=frameBufferBuilder.build();
  fbo.begin();
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  draw();
  Pixmap pixmap=ScreenUtils.getFrameBufferPixmap(0,0,w,h);
  fbo.end();
  ByteBuffer pixels=pixmap.getPixels();
  int numBytes=w * h * 4;
  byte[] lines=new byte[numBytes];
  int numBytesPerLine=w * 4;
  for (int i=0; i < h; i++) {
    pixels.position((h - i - 1) * numBytesPerLine);
    pixels.get(lines,i * numBytesPerLine,numBytesPerLine);
  }
  pixels.clear();
  pixels.put(lines);
  PixmapIO.writePNG(EngineAssetManager.getInstance().getUserFile(filename),pixmap);
}

Fixed version (ground truth):
public void takeScreenshot(String filename,int w){
  int h=(int)(w * getSceneCamera().viewportHeight / getSceneCamera().viewportWidth);
  FrameBuffer fbo=FrameBuffer.createFrameBuffer(Format.RGB565,w,h,false);
  fbo.begin();
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  draw();
  Pixmap pixmap=ScreenUtils.getFrameBufferPixmap(0,0,w,h);
  fbo.end();
  ByteBuffer pixels=pixmap.getPixels();
  int numBytes=w * h * 4;
  byte[] lines=new byte[numBytes];
  int numBytesPerLine=w * 4;
  for (int i=0; i < h; i++) {
    pixels.position((h - i - 1) * numBytesPerLine);
    pixels.get(lines,i * numBytesPerLine,numBytesPerLine);
  }
  pixels.clear();
  pixels.put(lines);
  PixmapIO.writePNG(EngineAssetManager.getInstance().getUserFile(filename),pixmap);
}
Program: 30173
Project: 30173
Buggy source:
@Override public boolean run(VerbRunner cb){
  Scene ts=null;
  if (scene == null)   ts=World.getInstance().getCurrentScene();
 else   ts=World.getInstance().getScene(scene);
  BaseActor a;
  if (actor != null) {
    a=World.getInstance().getInventory().get(actor);
    if (a == null) {
      EngineLogger.error(MessageFormat.format("String_Node_Str",actor));
      return false;
    }
    removeActor(ts,a);
  }
 else {
    int n=World.getInstance().getInventory().getNumItems();
    for (int i=0; i < n; i++) {
      a=World.getInstance().getInventory().get(i);
      removeActor(ts,a);
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  Scene ts=null;
  if (scene == null)   ts=World.getInstance().getCurrentScene();
 else   ts=World.getInstance().getScene(scene);
  BaseActor a;
  if (actor != null) {
    a=World.getInstance().getInventory().get(actor);
    if (a == null) {
      EngineLogger.error(MessageFormat.format("String_Node_Str",actor));
      return false;
    }
    removeActor(ts,a);
  }
 else {
    int n=World.getInstance().getInventory().getNumItems();
    for (int i=n - 1; i >= 0; i--) {
      a=World.getInstance().getInventory().get(i);
      removeActor(ts,a);
    }
  }
  return false;
}
Program: 30174
Project: 30174
Buggy source:
@Override public void touchUp(InputEvent event,float x,float y,int pointer,int button){
  super.touchUp(event,x,y,pointer,button);
  if (draggingMode == DraggingModes.DRAGGING_ACTOR) {
    Ctx.project.getUndoStack().add(new UndoPosition(selActor,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_REFPOINT) {
    Ctx.project.getUndoStack().add(new UndoRefPosition((InteractiveActor)selActor,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_WALKZONE_POINT) {
    Polygon poly=scnWidget.getScene().getPolygonalNavGraph().getWalkZone();
    Ctx.project.getUndoStack().add(new UndoWalkzonePointPos(poly,vertIndex,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_BBOX_POINT) {
    Ctx.project.getUndoStack().add(new UndoBboxPointPos((InteractiveActor)selActor,vertIndex,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_MARKER_0 || draggingMode == DraggingModes.DRAGGING_MARKER_100) {
    Ctx.project.getUndoStack().add(new UndoDepthVector(scnWidget.getScene(),new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_WALKZONE) {
    Ctx.project.getUndoStack().add(new UndoWalkZonePosition(scnWidget.getScene().getPolygonalNavGraph().getWalkZone(),new Vector2(undoOrg)));
  }
  draggingMode=DraggingModes.NONE;
  return;
}

Fixed version (ground truth):
@Override public void touchUp(InputEvent event,float x,float y,int pointer,int button){
  super.touchUp(event,x,y,pointer,button);
  if (draggingMode == DraggingModes.DRAGGING_ACTOR) {
    Ctx.project.getUndoStack().add(new UndoPosition(selActor,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_REFPOINT) {
    Ctx.project.getUndoStack().add(new UndoRefPosition((InteractiveActor)selActor,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_WALKZONE_POINT) {
    Polygon poly=scnWidget.getScene().getPolygonalNavGraph().getWalkZone();
    Ctx.project.getUndoStack().add(new UndoWalkzonePointPos(poly,vertIndex,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_BBOX_POINT) {
    Ctx.project.getUndoStack().add(new UndoBboxPointPos(selActor,vertIndex,new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_MARKER_0 || draggingMode == DraggingModes.DRAGGING_MARKER_100) {
    Ctx.project.getUndoStack().add(new UndoDepthVector(scnWidget.getScene(),new Vector2(undoOrg)));
  }
 else   if (draggingMode == DraggingModes.DRAGGING_WALKZONE) {
    Ctx.project.getUndoStack().add(new UndoWalkZonePosition(scnWidget.getScene().getPolygonalNavGraph().getWalkZone(),new Vector2(undoOrg)));
  }
  draggingMode=DraggingModes.NONE;
  return;
}
Program: 30175
Project: 30175
Buggy source:
public UndoBboxPointPos(InteractiveActor a,int i,Vector2 pos){
  this.pos=pos;
  this.a=a;
  this.i=i;
}

Fixed version (ground truth):
public UndoBboxPointPos(BaseActor a,int i,Vector2 pos){
  this.pos=pos;
  this.a=a;
  this.i=i;
}
Program: 30176
Project: 30176
Buggy source:
private void addToolBarButton(Skin skin,ImageButton button,String icon,String text,String tooltip){
  ImageButtonStyle style=new ImageButtonStyle(skin.get(ButtonStyle.class));
  TextureRegion image=Ctx.assetManager.getIcon(icon);
  style.imageUp=new TextureRegionDrawable(image);
  try {
    TextureRegion imageDisabled=Ctx.assetManager.getIcon(icon + "String_Node_Str");
    style.imageDisabled=new TextureRegionDrawable(imageDisabled);
  }
 catch (  Exception e) {
  }
  button.setStyle(style);
  add(button);
  button.setDisabled(true);
  TextTooltip t=new TextTooltip(tooltip,skin);
  button.addListener(t);
}

Fixed version (ground truth):
private void addToolBarButton(Skin skin,ImageButton button,String icon,String text,String tooltip){
  ImageButtonStyle style=new ImageButtonStyle(skin.get(ButtonStyle.class));
  TextureRegion image=Ctx.assetManager.getIcon(icon);
  style.imageUp=new TextureRegionDrawable(image);
  try {
    TextureRegion imageDisabled=Ctx.assetManager.getIcon(icon + "String_Node_Str");
    if (imageDisabled != null)     style.imageDisabled=new TextureRegionDrawable(imageDisabled);
  }
 catch (  Exception e) {
  }
  button.setStyle(style);
  add(button);
  button.setDisabled(true);
  TextTooltip t=new TextTooltip(tooltip,skin);
  button.addListener(t);
}
Program: 30177
Project: 30177
Buggy source:
@Override protected String getCellSubTitle(BaseActor e){
  if (e instanceof InteractiveActor)   return Ctx.project.translate(((InteractiveActor)e).getDesc());
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override protected String getCellSubTitle(BaseActor e){
  if (e instanceof SpriteActor && ((SpriteActor)e).getRenderer() instanceof TextRenderer && ((TextRenderer)((SpriteActor)e).getRenderer()).getText() != null)   return Ctx.project.translate(((TextRenderer)((SpriteActor)e).getRenderer()).getText()).replace("String_Node_Str","String_Node_Str");
  if (e instanceof InteractiveActor)   return Ctx.project.translate(((InteractiveActor)e).getDesc());
  return "String_Node_Str";
}
Program: 30179
Project: 30179
Buggy source:
@Override public boolean run(VerbRunner cb){
  try {
    World.getInstance().loadChapter(chapter,scene);
  }
 catch (  Exception e) {
    EngineLogger.error(e.getMessage());
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  try {
    World.getInstance().loadChapter(chapter,scene,false);
  }
 catch (  Exception e) {
    EngineLogger.error(e.getMessage());
  }
  return true;
}
Program: 30180
Project: 30180
Buggy source:
public void loadChapter(String chapter,String scene) throws Exception {
  this.testScene=scene;
  loadChapter(chapter);
  if (testScene != null) {
    currentScene=null;
    setCurrentScene(testScene);
  }
}

Fixed version (ground truth):
public void loadChapter(String chapter,String scene,boolean test) throws Exception {
  if (test)   this.testScene=scene;
  loadChapter(chapter);
  if (scene != null) {
    currentScene=null;
    setCurrentScene(scene);
  }
}
Program: 30181
Project: 30181
Buggy source:
@Override public void write(Json json){
  json.writeValue("String_Node_Str",inScreenTime);
  json.writeValue("String_Node_Str",currentText);
  json.writeValue("String_Node_Str",new ArrayList<Text>(fifo),ArrayList.class,Text.class);
}

Fixed version (ground truth):
@Override public void write(Json json){
  json.writeValue("String_Node_Str",inScreenTime);
  if (currentText != null)   json.writeValue("String_Node_Str",currentText);
  json.writeValue("String_Node_Str",new ArrayList<Text>(fifo),ArrayList.class,Text.class);
}
Program: 30182
Project: 30182
Buggy source:
public boolean checkProjectStructure(){
  if (!new File(getModelPath()).exists()) {
    projectFile=projectFile.getParentFile();
    if (new File(getModelPath()).exists())     return true;
 else     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks if the model folder exists in the passed folder or in his parent.
 * @return The correct project folder or null if the model folder is not found.
 */
private File checkProjectStructure(File folder){
  File projectFolder=folder;
  if (!new File(projectFolder.getAbsolutePath() + MODEL_PATH).exists()) {
    projectFolder=projectFolder.getParentFile();
    if (!new File(projectFolder.getAbsolutePath() + MODEL_PATH).exists())     return null;
  }
  return projectFolder;
}
Program: 30184
Project: 30184
Buggy source:
public void createProject(String projectDir,String name,String pkg,String sdkLocation,boolean spinePlugin) throws IOException {
  createLibGdxProject(projectDir,name,pkg,"String_Node_Str",sdkLocation,spinePlugin);
  projectFile=new File(projectDir + "String_Node_Str" + name);
  loadProject(projectFile);
}

Fixed version (ground truth):
public void createProject(String projectDir,String name,String pkg,String sdkLocation,boolean spinePlugin) throws IOException {
  closeProject();
  createLibGdxProject(projectDir,name,pkg,"String_Node_Str",sdkLocation,spinePlugin);
  projectFile=new File(projectDir + "String_Node_Str" + name);
  loadProject(projectFile);
}
Program: 30185
Project: 30185
Buggy source:
public void closeProject(){
  this.projectFile=null;
}

Fixed version (ground truth):
public void closeProject(){
  setSelectedScene(null);
  this.projectFile=null;
}
Program: 30187
Project: 30187
Buggy source:
private void nextStep(){
  if (ip >= actions.size() || ip < 0) {
    continueMaximally();
  }
 else {
    boolean stop=false;
    while (ip < actions.size() && !stop) {
      Action a=actions.get(ip);
      try {
        if (a.run(this))         stop=true;
 else         ip++;
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName(),e);
        ip++;
      }
    }
  }
}

Fixed version (ground truth):
private void nextStep(){
  if (ip < 0) {
    continueMaximally();
  }
 else {
    boolean stop=false;
    while (ip < actions.size() && !stop) {
      Action a=actions.get(ip);
      try {
        if (a.run(this))         stop=true;
 else         ip++;
      }
 catch (      Exception e) {
        EngineLogger.error("String_Node_Str" + a.getClass().getSimpleName(),e);
        ip++;
      }
    }
    if (ip >= actions.size() && !stop)     continueMaximally();
  }
}
Program: 30188
Project: 30188
Buggy source:
@Override public void render(float delta){
  SpriteBatch batch=ui.getBatch();
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batch.setProjectionMatrix(viewport.getCamera().combined);
  batch.begin();
  if (time > FADE_TIME * 2 + SCREEN_TIME) {
    batch.setColor(Color.WHITE);
    ui.setCurrentScreen(Screens.MENU_SCREEN);
    return;
  }
 else   if (time > FADE_TIME + SCREEN_TIME) {
    batch.setColor(1,1,1,1 - fadeTime / FADE_TIME);
  }
 else   if (time < FADE_TIME) {
    batch.setColor(1,1,1,fadeTime / FADE_TIME);
  }
 else {
    fadeTime=0;
  }
  final int viewportW=viewport.getScreenWidth();
  final int viewportH=viewport.getScreenHeight();
  final float texW=tex.getWidth() * scale;
  final float texH=tex.getHeight() * scale;
  batch.draw(tex,(viewportW - texW) / 2,(viewportH - texH) / 2,texW,texH);
  batch.setColor(1,1,1,1);
  time+=delta;
  fadeTime+=delta;
  batch.end();
}

Fixed version (ground truth):
@Override public void render(float delta){
  SpriteBatch batch=ui.getBatch();
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batch.setProjectionMatrix(viewport.getCamera().combined);
  batch.begin();
  if (time > FADE_TIME * 2 + SCREEN_TIME) {
    batch.setColor(Color.WHITE);
    ui.setCurrentScreen(Screens.MENU_SCREEN);
    batch.end();
    return;
  }
 else   if (time > FADE_TIME + SCREEN_TIME) {
    batch.setColor(1,1,1,1 - fadeTime / FADE_TIME);
  }
 else   if (time < FADE_TIME) {
    batch.setColor(1,1,1,fadeTime / FADE_TIME);
  }
 else {
    fadeTime=0;
  }
  final int viewportW=viewport.getScreenWidth();
  final int viewportH=viewport.getScreenHeight();
  final float texW=tex.getWidth() * scale;
  final float texH=tex.getHeight() * scale;
  batch.draw(tex,(viewportW - texW) / 2,(viewportH - texH) / 2,texW,texH);
  batch.setColor(Color.WHITE);
  time+=delta;
  fadeTime+=delta;
  batch.end();
}
Program: 30189
Project: 30189
Buggy source:
public void pause(){
  paused=true;
  if (currentScene != null) {
    musicEngine.pauseMusic();
    for (    BaseActor a : currentScene.getActors().values()) {
      if (a instanceof InteractiveActor) {
        String playingSound=((InteractiveActor)a).getPlayingSound();
        if (playingSound != null)         ((InteractiveActor)a).getSounds().get(playingSound).pause();
      }
    }
  }
}

Fixed version (ground truth):
public void pause(){
  paused=true;
  if (currentScene != null) {
    if (assetState == AssetState.LOADED)     musicEngine.pauseMusic();
    for (    BaseActor a : currentScene.getActors().values()) {
      if (a instanceof InteractiveActor) {
        String playingSound=((InteractiveActor)a).getPlayingSound();
        if (playingSound != null)         ((InteractiveActor)a).getSounds().get(playingSound).pause();
      }
    }
  }
}
Program: 30190
Project: 30190
Buggy source:
public void loadChapter(String selChapter) throws IOException {
  undoStack.clear();
  try {
    chapter.load(selChapter);
  }
 catch (  SerializationException ex) {
    if (ex.getCause() != null && ex.getCause().getCause() != null && ex.getCause().getCause() instanceof ClassNotFoundException) {
      EditorLogger.debug("String_Node_Str");
      if (RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str")) {
        chapter.load(selChapter);
      }
 else {
        throw new IOException("String_Node_Str");
      }
    }
 else {
      throw ex;
    }
  }
  i18n.load(selChapter);
}

Fixed version (ground truth):
public void loadChapter(String selChapter) throws IOException {
  undoStack.clear();
  try {
    chapter.load(selChapter);
  }
 catch (  SerializationException ex) {
    if (ex.getCause() != null && ex.getCause() instanceof ClassNotFoundException) {
      EditorLogger.debug("String_Node_Str");
      if (RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str")) {
        FolderClassLoader folderClassLoader=new FolderClassLoader(projectFile.getAbsolutePath() + "String_Node_Str");
        ActionFactory.setActionClassLoader(folderClassLoader);
        chapter.load(selChapter);
      }
 else {
        throw new IOException("String_Node_Str");
      }
    }
 else {
      throw ex;
    }
  }
  i18n.load(selChapter);
}
Program: 30191
Project: 30191
Buggy source:
@Override protected void delete(){
  if (list.getSelection().size() == 0)   return;
  multiClipboard.clear();
  int pos=list.getSelectedIndex();
  for (  Action e : getSortedSelection()) {
    if (e instanceof EndAction)     continue;
    list.getItems().removeValue(e,true);
    int idx=parent.getActions().indexOf(e);
    parent.getActions().remove(e);
    multiClipboard.add(e);
    if (scope.equals(ScopePanel.WORLD_SCOPE))     Ctx.project.getI18N().putTranslationsInElement(e,true);
 else     Ctx.project.getI18N().putTranslationsInElement(e,false);
    Ctx.project.getUndoStack().add(new UndoDeleteAction(parent,e,idx));
    if (isControlAction(e))     deleteControlAction(list.getItems().indexOf(e,true),(AbstractControlAction)e);
  }
  if (list.getItems().size == 0) {
    list.getSelection().clear();
  }
 else   if (pos >= list.getItems().size) {
    list.getSelection().choose(list.getItems().get(list.getItems().size - 1));
  }
 else {
    list.getSelection().choose(list.getItems().get(pos));
  }
  toolbar.disablePaste(false);
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void delete(){
  if (list.getSelection().size() == 0)   return;
  multiClipboard.clear();
  int pos=list.getSelectedIndex();
  for (  Action e : getSortedSelection()) {
    if (e instanceof EndAction)     continue;
    int pos2=list.getItems().indexOf(e,true);
    list.getItems().removeValue(e,true);
    int idx=parent.getActions().indexOf(e);
    parent.getActions().remove(e);
    multiClipboard.add(e);
    if (scope.equals(ScopePanel.WORLD_SCOPE))     Ctx.project.getI18N().putTranslationsInElement(e,true);
 else     Ctx.project.getI18N().putTranslationsInElement(e,false);
    Ctx.project.getUndoStack().add(new UndoDeleteAction(parent,e,idx));
    if (isControlAction(e))     deleteControlAction(pos2,(AbstractControlAction)e);
  }
  if (list.getItems().size == 0) {
    list.getSelection().clear();
  }
 else   if (pos >= list.getItems().size) {
    list.getSelection().choose(list.getItems().get(list.getItems().size - 1));
  }
 else {
    list.getSelection().choose(list.getItems().get(pos));
  }
  toolbar.disablePaste(false);
  Ctx.project.setModified();
}
Program: 30192
Project: 30192
Buggy source:
@Override protected void edit(){
  Action e=list.getSelected();
  if (e == null || e instanceof EndAction || e instanceof DisableActionAction)   return;
  editedElement=(Action)ElementUtils.cloneElement(e);
  EditModelDialog<Verb,Action> dialog=getEditElementDialogInstance(e);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @SuppressWarnings("String_Node_Str") @Override public void changed(    ChangeEvent event,    Actor actor){
      Action e=((EditModelDialog<Verb,Action>)actor).getElement();
      int pos=list.getSelectedIndex();
      list.getItems().set(pos,e);
      parent.getActions().set(pos,e);
      Ctx.project.setModified();
      if (isControlAction(editedElement)) {
        if (!editedElement.getClass().getName().equals(e.getClass().getName())) {
          deleteControlAction(list.getSelectedIndex(),(AbstractControlAction)editedElement);
          if (isControlAction(e)) {
            insertEndAction(list.getSelectedIndex() + 1,getOrCreateControlActionId((AbstractControlAction)e));
            if (e instanceof AbstractIfAction)             insertEndAction(list.getSelectedIndex() + 2,getOrCreateControlActionId((AbstractControlAction)e));
          }
        }
 else {
          try {
            ActionUtils.setParam(e,CONTROL_ACTION_ID_ATTR,getOrCreateControlActionId((AbstractControlAction)editedElement));
          }
 catch (          NoSuchFieldException|IllegalArgumentException|IllegalAccessException e1) {
            EditorLogger.error(e1.getMessage());
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void edit(){
  Action e=list.getSelected();
  if (e == null || e instanceof EndAction || e instanceof DisableActionAction)   return;
  editedElement=(Action)ElementUtils.cloneElement(e);
  EditModelDialog<Verb,Action> dialog=getEditElementDialogInstance(e);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @SuppressWarnings("String_Node_Str") @Override public void changed(    ChangeEvent event,    Actor actor){
      Action e=((EditModelDialog<Verb,Action>)actor).getElement();
      int pos=list.getSelectedIndex();
      list.getItems().set(pos,e);
      parent.getActions().set(pos,e);
      Ctx.project.setModified();
      if (isControlAction(editedElement)) {
        if (!editedElement.getClass().getName().equals(e.getClass().getName())) {
          deleteControlAction(pos,(AbstractControlAction)editedElement);
          if (isControlAction(e)) {
            insertEndAction(pos + 1,getOrCreateControlActionId((AbstractControlAction)e));
            if (e instanceof AbstractIfAction)             insertEndAction(pos + 2,getOrCreateControlActionId((AbstractControlAction)e));
          }
        }
 else {
          try {
            ActionUtils.setParam(e,CONTROL_ACTION_ID_ATTR,getOrCreateControlActionId((AbstractControlAction)editedElement));
          }
 catch (          NoSuchFieldException|IllegalArgumentException|IllegalAccessException e1) {
            EditorLogger.error(e1.getMessage());
          }
        }
      }
    }
  }
);
}
Program: 30193
Project: 30193
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void changed(ChangeEvent event,Actor actor){
  Action e=((EditModelDialog<Verb,Action>)actor).getElement();
  int pos=list.getSelectedIndex();
  list.getItems().set(pos,e);
  parent.getActions().set(pos,e);
  Ctx.project.setModified();
  if (isControlAction(editedElement)) {
    if (!editedElement.getClass().getName().equals(e.getClass().getName())) {
      deleteControlAction(list.getSelectedIndex(),(AbstractControlAction)editedElement);
      if (isControlAction(e)) {
        insertEndAction(list.getSelectedIndex() + 1,getOrCreateControlActionId((AbstractControlAction)e));
        if (e instanceof AbstractIfAction)         insertEndAction(list.getSelectedIndex() + 2,getOrCreateControlActionId((AbstractControlAction)e));
      }
    }
 else {
      try {
        ActionUtils.setParam(e,CONTROL_ACTION_ID_ATTR,getOrCreateControlActionId((AbstractControlAction)editedElement));
      }
 catch (      NoSuchFieldException|IllegalArgumentException|IllegalAccessException e1) {
        EditorLogger.error(e1.getMessage());
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void changed(ChangeEvent event,Actor actor){
  Action e=((EditModelDialog<Verb,Action>)actor).getElement();
  int pos=list.getSelectedIndex();
  list.getItems().set(pos,e);
  parent.getActions().set(pos,e);
  Ctx.project.setModified();
  if (isControlAction(editedElement)) {
    if (!editedElement.getClass().getName().equals(e.getClass().getName())) {
      deleteControlAction(pos,(AbstractControlAction)editedElement);
      if (isControlAction(e)) {
        insertEndAction(pos + 1,getOrCreateControlActionId((AbstractControlAction)e));
        if (e instanceof AbstractIfAction)         insertEndAction(pos + 2,getOrCreateControlActionId((AbstractControlAction)e));
      }
    }
 else {
      try {
        ActionUtils.setParam(e,CONTROL_ACTION_ID_ATTR,getOrCreateControlActionId((AbstractControlAction)editedElement));
      }
 catch (      NoSuchFieldException|IllegalArgumentException|IllegalAccessException e1) {
        EditorLogger.error(e1.getMessage());
      }
    }
  }
}
Program: 30195
Project: 30195
Buggy source:
@Override public void show(){
  final Locale locale=I18N.getCurrentLocale();
  String filename=null;
  UIModes uiMode=UIModes.valueOf(Config.getProperty(Config.UI_MODE,"String_Node_Str").toUpperCase());
  if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) {
    uiMode=UIModes.PIE;
  }
switch (uiMode) {
case PIE:
    filename=PIE_FILENAME;
  break;
case SINGLE_CLICK:
filename=SINGLE_CLICK_FILENAME;
break;
case TWO_BUTTONS:
filename=TWO_BUTTONS_FILENAME;
break;
}
localeFilename=MessageFormat.format("String_Node_Str",filename,locale.getLanguage());
if (!EngineAssetManager.getInstance().assetExists(localeFilename)) localeFilename=MessageFormat.format("String_Node_Str",filename);
tex=new Texture(EngineAssetManager.getInstance().getResAsset(localeFilename));
tex.setFilter(TextureFilter.Linear,TextureFilter.Linear);
Gdx.input.setInputProcessor(inputProcessor);
}

Fixed version (ground truth):
@Override public void show(){
  final Locale locale=I18N.getCurrentLocale();
  String filename=null;
  UIModes uiMode=UIModes.valueOf(Config.getProperty(Config.UI_MODE,"String_Node_Str").toUpperCase(Locale.ENGLISH));
  if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) {
    uiMode=UIModes.PIE;
  }
switch (uiMode) {
case PIE:
    filename=PIE_FILENAME;
  break;
case SINGLE_CLICK:
filename=SINGLE_CLICK_FILENAME;
break;
case TWO_BUTTONS:
filename=TWO_BUTTONS_FILENAME;
break;
}
localeFilename=MessageFormat.format("String_Node_Str",filename,locale.getLanguage());
if (!EngineAssetManager.getInstance().assetExists(localeFilename)) localeFilename=MessageFormat.format("String_Node_Str",filename);
tex=new Texture(EngineAssetManager.getInstance().getResAsset(localeFilename));
tex.setFilter(TextureFilter.Linear,TextureFilter.Linear);
Gdx.input.setInputProcessor(inputProcessor);
}
Program: 30197
Project: 30197
Buggy source:
@Override public void setUI(UI ui){
  this.ui=ui;
  recorder=ui.getRecorder();
  testerBot=ui.getTesterBot();
  pie=new PieMenu(this);
  textManagerUI=new TextManagerUI(ui.getSkin());
  menuButton=new Button(ui.getSkin(),"String_Node_Str");
  dialogUI=new DialogUI(ui);
  pointer=new ScenePointer(ui.getSkin());
  inventoryUI=new InventoryUI(this,pointer);
  inventoryButton=new InventoryButton(ui.getSkin(),inventoryUI);
  uiMode=UIModes.valueOf(Config.getProperty(Config.UI_MODE,"String_Node_Str").toUpperCase());
  if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) {
    uiMode=UIModes.PIE;
  }
  pie.setVisible(false);
}

Fixed version (ground truth):
@Override public void setUI(UI ui){
  this.ui=ui;
  recorder=ui.getRecorder();
  testerBot=ui.getTesterBot();
  pie=new PieMenu(this);
  textManagerUI=new TextManagerUI(ui.getSkin());
  menuButton=new Button(ui.getSkin(),"String_Node_Str");
  dialogUI=new DialogUI(ui);
  pointer=new ScenePointer(ui.getSkin());
  inventoryUI=new InventoryUI(this,pointer);
  inventoryButton=new InventoryButton(ui.getSkin(),inventoryUI);
  uiMode=UIModes.valueOf(Config.getProperty(Config.UI_MODE,"String_Node_Str").toUpperCase(Locale.ENGLISH));
  if (Gdx.input.isPeripheralAvailable(Peripheral.MultitouchScreen) && uiMode == UIModes.TWO_BUTTONS) {
    uiMode=UIModes.PIE;
  }
  pie.setVisible(false);
}
Program: 30200
Project: 30200
Buggy source:
public Main(Editor editor,LwjglApplicationConfiguration cfg){
  super(editor,cfg);
  Gdx.graphics.setWindowedMode((int)(Gdx.graphics.getDisplayMode().width * 0.9),(int)(Gdx.graphics.getDisplayMode().height * 0.9));
}

Fixed version (ground truth):
public Main(Editor editor,LwjglApplicationConfiguration cfg){
  super(editor,cfg);
  Gdx.graphics.setWindowedMode(Math.max((int)(Gdx.graphics.getDisplayMode().width * 0.9),1920 / 2),Math.max((int)(Gdx.graphics.getDisplayMode().height * 0.9),1080 / 2));
}
Program: 30201
Project: 30201
Buggy source:
@Override public void update(float delta){
  if (complete)   return;
  if (currentSource != null && currentSource.skeleton != null) {
    float d=delta;
    if (currentAnimationType == Tween.Type.REVERSE) {
      d=-delta;
      if (lastAnimationTime < 0) {
        lastAnimationTime=0;
        animationListener.complete(0,1);
        return;
      }
    }
    lastAnimationTime+=d;
    if (lastAnimationTime >= 0)     updateAnimation(d);
  }
}

Fixed version (ground truth):
@Override public void update(float delta){
  if (complete) {
    return;
  }
  if (currentSource != null && currentSource.skeleton != null) {
    float d=delta;
    if (currentAnimationType == Tween.Type.REVERSE) {
      d=-delta;
      if (lastAnimationTime < 0) {
        lastAnimationTime=0;
        animationListener.complete(0,1);
        return;
      }
    }
    lastAnimationTime+=d;
    if (lastAnimationTime >= 0)     updateAnimation(d);
  }
}
Program: 30202
Project: 30202
Buggy source:
@Override public void complete(int trackIndex,int loopCount){
  if (complete)   return;
  if ((currentAnimationType == Tween.Type.REPEAT || currentAnimationType == Tween.Type.REVERSE_REPEAT) && (currentCount == Tween.INFINITY || currentCount > loopCount)) {
    return;
  }
  complete=true;
  computeBbox();
  if (animationCb != null) {
    ActionCallbackQueue.add(animationCb);
    animationCb=null;
  }
}

Fixed version (ground truth):
@Override public void complete(int trackIndex,int loopCount){
  if (complete)   return;
  if ((currentAnimationType == Tween.Type.REPEAT || currentAnimationType == Tween.Type.REVERSE_REPEAT) && (currentCount == Tween.INFINITY || currentCount > loopCount)) {
    currentSource.skeleton.setToSetupPose();
    currentSource.skeleton.setFlipX(flipX);
    complete=true;
    currentSource.animation.update(0);
    currentSource.animation.apply(currentSource.skeleton);
    currentSource.skeleton.updateWorldTransform();
    complete=false;
    return;
  }
  complete=true;
  computeBbox();
  if (animationCb != null) {
    ActionCallbackQueue.add(animationCb);
    animationCb=null;
  }
}
Program: 30203
Project: 30203
Buggy source:
public void update(AtlasRenderer a,float delta){
  update(delta);
  if (!isComplete())   a.setFrame((int)(getPercent() * a.getNumFrames()));
}

Fixed version (ground truth):
public void update(AtlasRenderer a,float delta){
  update(delta);
  if (!isComplete() && getPercent() < 1.0f)   a.setFrame((int)(getPercent() * a.getNumFrames()));
}