nus-yam/ex-repair huggingface dataset:
Program: 30204
Project: 30204
Buggy source:
@Override protected void paste(){
  BaseActor newElement=(BaseActor)ElementUtils.cloneElement(clipboard);
  newElement.setId(ElementUtils.getCheckedId(newElement.getId(),parent.getActors().keySet().toArray(new String[0])));
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  parent.addActor(newElement);
  Ctx.project.getI18N().extractStrings(parent.getId(),newElement);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void paste(){
  BaseActor newElement=(BaseActor)ElementUtils.cloneElement(clipboard);
  newElement.setId(ElementUtils.getCheckedId(newElement.getId(),parent.getActors().keySet().toArray(new String[0])));
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  parent.addActor(newElement);
  Ctx.project.getI18N().extractStrings(parent.getId(),newElement);
  if (newElement instanceof InteractiveActor) {
    InteractiveActor ia=(InteractiveActor)newElement;
    ia.loadAssets();
    EngineAssetManager.getInstance().finishLoading();
    ia.retrieveAssets();
  }
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
}
Program: 30207
Project: 30207
Buggy source:
@Override protected void modelToInputs(){
  id.setText(e.getId());
  filename.setText(e.getFilename());
  loop.setText(Boolean.toString(e.getLoop()));
  volume.setText(Float.toString(e.getVolume()));
  pan.setText(Float.toString(e.getPan()));
  loop.setText(Boolean.toString(e.isPreload()));
}

Fixed version (ground truth):
@Override protected void modelToInputs(){
  id.setText(e.getId());
  filename.setText(e.getFilename());
  loop.setText(Boolean.toString(e.getLoop()));
  volume.setText(Float.toString(e.getVolume()));
  pan.setText(Float.toString(e.getPan()));
  preload.setText(Boolean.toString(e.isPreload()));
}
Program: 30208
Project: 30208
Buggy source:
public void update(float delta){
  if (complete)   return;
  if (!began) {
    began=true;
  }
  time+=delta;
  if (time >= duration) {
    if (type == Type.NO_REPEAT || type == Type.REVERSE || count == 1) {
      complete=true;
    }
 else     if (count != 1) {
      complete=false;
      count--;
      time=0;
      if (type == Type.YOYO)       reverse=!reverse;
    }
  }
  if (complete) {
    callCb();
  }
}

Fixed version (ground truth):
public void update(float delta){
  if (complete)   return;
  if (!began) {
    began=true;
  }
  time+=delta;
  if (time >= duration) {
    if (type == Type.NO_REPEAT || type == Type.REVERSE || count == 1) {
      complete=true;
    }
 else     if (count != 1) {
      complete=false;
      count--;
      time=0.00001f;
      if (type == Type.YOYO)       reverse=!reverse;
    }
  }
  if (complete) {
    callCb();
  }
}
Program: 30209
Project: 30209
Buggy source:
@Override public void scopeChanged(String scope){
  if (WORLD_SCOPE.equals(scope)) {
    addElements(World.getInstance().getVerbManager(),Arrays.asList(World.getInstance().getVerbManager().getVerbs().values().toArray(new Verb[0])));
  }
 else   if (SCENE_SCOPE.equals(scope)) {
    addElements(Ctx.project.getSelectedScene().getVerbManager(),Arrays.asList(Ctx.project.getSelectedScene().getVerbManager().getVerbs().values().toArray(new Verb[0])));
  }
 else   if (ACTOR_SCOPE.equals(scope)) {
    BaseActor a=Ctx.project.getSelectedActor();
    if (a instanceof InteractiveActor) {
      addElements(((InteractiveActor)a).getVerbManager(),Arrays.asList(((InteractiveActor)a).getVerbManager().getVerbs().values().toArray(new Verb[0])));
    }
 else {
      addElements(null,null);
    }
  }
}

Fixed version (ground truth):
@Override public void scopeChanged(String scope){
  if (WORLD_SCOPE.equals(scope)) {
    addElements(World.getInstance().getVerbManager(),Arrays.asList(World.getInstance().getVerbManager().getVerbs().values().toArray(new Verb[0])));
  }
 else   if (SCENE_SCOPE.equals(scope)) {
    if (Ctx.project.getSelectedScene() != null)     addElements(Ctx.project.getSelectedScene().getVerbManager(),Arrays.asList(Ctx.project.getSelectedScene().getVerbManager().getVerbs().values().toArray(new Verb[0])));
 else     addElements(null,null);
  }
 else   if (ACTOR_SCOPE.equals(scope)) {
    BaseActor a=Ctx.project.getSelectedActor();
    if (a instanceof InteractiveActor) {
      addElements(((InteractiveActor)a).getVerbManager(),Arrays.asList(((InteractiveActor)a).getVerbManager().getVerbs().values().toArray(new Verb[0])));
    }
 else {
      addElements(null,null);
    }
  }
}
Program: 30213
Project: 30213
Buggy source:
@Override public boolean keyUp(int keycode){
switch (keycode) {
case Input.Keys.ESCAPE:
case Input.Keys.BACK:
case Input.Keys.MENU:
    showMenu();
  break;
case Input.Keys.SPACE:
if (drawHotspots) drawHotspots=false;
break;
}
return true;
}

Fixed version (ground truth):
@Override public boolean keyUp(int keycode){
switch (keycode) {
case Input.Keys.ESCAPE:
case Input.Keys.BACK:
case Input.Keys.MENU:
    showMenu();
  break;
case Input.Keys.D:
if (UIUtils.ctrl()) EngineLogger.toggle();
break;
case Input.Keys.SPACE:
if (drawHotspots) drawHotspots=false;
break;
}
return true;
}
Program: 30214
Project: 30214
Buggy source:
@Override public boolean keyTyped(char character){
switch (character) {
case 'd':
    if (UIUtils.ctrl())     EngineLogger.toggle();
  break;
case '1':
EngineLogger.setDebugLevel(EngineLogger.DEBUG0);
break;
case '2':
EngineLogger.setDebugLevel(EngineLogger.DEBUG1);
break;
case '3':
EngineLogger.setDebugLevel(EngineLogger.DEBUG2);
break;
case 'f':
break;
case 's':
try {
World.getInstance().saveGameState();
}
 catch (IOException e) {
EngineLogger.error(e.getMessage());
}
break;
case 'l':
try {
World.getInstance().loadGameState();
}
 catch (IOException e) {
EngineLogger.error(e.getMessage());
}
break;
case 't':
testerBot.setEnabled(!testerBot.isEnabled());
break;
case '.':
if (recorder.isRecording()) recorder.setRecording(false);
 else recorder.setRecording(true);
break;
case ',':
if (recorder.isPlaying()) recorder.setPlaying(false);
 else {
recorder.load();
recorder.setPlaying(true);
}
break;
case 'p':
if (World.getInstance().isPaused()) {
World.getInstance().resume();
}
 else {
World.getInstance().pause();
}
break;
case ' ':
if (state == UIStates.SCENE_MODE) {
drawHotspots=true;
}
break;
}
return false;
}

Fixed version (ground truth):
@Override public boolean keyTyped(char character){
switch (character) {
case '1':
    EngineLogger.setDebugLevel(EngineLogger.DEBUG0);
  break;
case '2':
EngineLogger.setDebugLevel(EngineLogger.DEBUG1);
break;
case '3':
EngineLogger.setDebugLevel(EngineLogger.DEBUG2);
break;
case 'f':
break;
case 's':
try {
World.getInstance().saveGameState();
}
 catch (IOException e) {
EngineLogger.error(e.getMessage());
}
break;
case 'l':
try {
World.getInstance().loadGameState();
}
 catch (IOException e) {
EngineLogger.error(e.getMessage());
}
break;
case 't':
testerBot.setEnabled(!testerBot.isEnabled());
break;
case '.':
if (recorder.isRecording()) recorder.setRecording(false);
 else recorder.setRecording(true);
break;
case ',':
if (recorder.isPlaying()) recorder.setPlaying(false);
 else {
recorder.load();
recorder.setPlaying(true);
}
break;
case 'p':
if (World.getInstance().isPaused()) {
World.getInstance().resume();
}
 else {
World.getInstance().pause();
}
break;
case ' ':
if (state == UIStates.SCENE_MODE) {
drawHotspots=true;
}
break;
}
return false;
}
Program: 30215
Project: 30215
Buggy source:
private void processCreditMusic(String s){
  if (music != null)   music.dispose();
  music=Gdx.audio.newMusic(EngineAssetManager.getInstance().getAsset("String_Node_Str" + s));
  music.play();
}

Fixed version (ground truth):
private void processCreditMusic(String s){
  if (music != null)   music.dispose();
  music=Gdx.audio.newMusic(EngineAssetManager.getInstance().getAsset("String_Node_Str" + s));
  music.play();
  stringHead++;
}
Program: 30216
Project: 30216
Buggy source:
@Override public boolean run(VerbRunner cb){
  Scene s=actor.getScene();
  final String actorId=actor.getActorId();
  if (actorId == null) {
    EngineLogger.error(getClass() + "String_Node_Str");
    return false;
  }
  InteractiveActor a=(InteractiveActor)s.getActor(actorId,false);
  s.removeActor(a);
  if (s == World.getInstance().getCurrentScene())   a.dispose();
  Scene ts=null;
  if (scene == null)   ts=World.getInstance().getCurrentScene();
 else   ts=World.getInstance().getScene(scene);
  if (ts == World.getInstance().getCurrentScene()) {
    a.loadAssets();
    EngineAssetManager.getInstance().finishLoading();
    a.retrieveAssets();
  }
  ts.addActor(a);
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  final Scene s=actor.getScene();
  final String actorId=actor.getActorId();
  final World w=World.getInstance();
  if (actorId == null) {
    EngineLogger.error(getClass() + "String_Node_Str");
    return false;
  }
  InteractiveActor a=(InteractiveActor)s.getActor(actorId,false);
  s.removeActor(a);
  if (s == w.getCurrentScene())   a.dispose();
  Scene ts=null;
  if (scene == null)   ts=w.getCurrentScene();
 else   ts=w.getScene(scene);
  if (ts == w.getCurrentScene() || (w.getCachedScene(ts.getId()) != null)) {
    a.loadAssets();
    EngineAssetManager.getInstance().finishLoading();
    a.retrieveAssets();
  }
  ts.addActor(a);
  return false;
}
Program: 30217
Project: 30217
Buggy source:
public void lookat(String direction){
  inAnim();
  posTween=null;
  renderer.startAnimation(standAnim,Tween.Type.SPRITE_DEFINED,-1,null,direction);
  outAnim();
}

Fixed version (ground truth):
public void lookat(String direction){
  inAnim();
  posTween=null;
  renderer.startAnimation(standAnim,Tween.Type.SPRITE_DEFINED,-1,null,direction);
  outAnim(Tween.Type.SPRITE_DEFINED);
}
Program: 30218
Project: 30218
Buggy source:
public void startWalkAnim(Vector2 p0,Vector2 pf){
  inAnim();
  renderer.startAnimation(walkAnim,Tween.Type.SPRITE_DEFINED,-1,null,p0,pf);
  outAnim();
}

Fixed version (ground truth):
public void startWalkAnim(Vector2 p0,Vector2 pf){
  inAnim();
  renderer.startAnimation(walkAnim,Tween.Type.SPRITE_DEFINED,-1,null,p0,pf);
  outAnim(Tween.Type.SPRITE_DEFINED);
}
Program: 30219
Project: 30219
Buggy source:
public void talk(){
  inAnim();
  posTween=null;
  renderer.startAnimation(talkAnim,Tween.Type.SPRITE_DEFINED,-1,null,null);
  outAnim();
}

Fixed version (ground truth):
public void talk(){
  inAnim();
  posTween=null;
  renderer.startAnimation(talkAnim,Tween.Type.SPRITE_DEFINED,-1,null,null);
  outAnim(Tween.Type.SPRITE_DEFINED);
}
Program: 30220
Project: 30220
Buggy source:
public void stand(){
  inAnim();
  posTween=null;
  renderer.startAnimation(standAnim,Tween.Type.SPRITE_DEFINED,-1,null,null);
  outAnim();
}

Fixed version (ground truth):
public void stand(){
  inAnim();
  posTween=null;
  renderer.startAnimation(standAnim,Tween.Type.SPRITE_DEFINED,-1,null,null);
  outAnim(Tween.Type.SPRITE_DEFINED);
}
Program: 30221
Project: 30221
Buggy source:
/** 
 * Actions to do when setting an animation: - play animation sound - add 'in' distance
 */
protected void outAnim(){
  AnimationDesc fa=renderer.getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null && fa.animationType != Tween.Type.REVERSE) {
      playSound(fa.sound);
    }
    Vector2 inD=fa.inD;
    if (inD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + inD.x * s,getY() + inD.y * s);
    }
  }
}

Fixed version (ground truth):
/** 
 * Actions to do when setting an animation: - play animation sound - add 'in' distance
 * @param repeatType 
 */
protected void outAnim(Type repeatType){
  AnimationDesc fa=renderer.getCurrentAnimation();
  if (fa != null) {
    if (fa.sound != null && repeatType != Tween.Type.REVERSE) {
      playSound(fa.sound);
    }
    Vector2 inD=fa.inD;
    if (inD != null) {
      float s=EngineAssetManager.getInstance().getScale();
      setPosition(getX() + inD.x * s,getY() + inD.y * s);
    }
  }
}
Program: 30222
Project: 30222
Buggy source:
public void startAnimation(String id,Tween.Type repeatType,int count,ActionCallback cb){
  inAnim();
  if (posTween != null && posTween instanceof WalkTween)   posTween=null;
  EngineLogger.debug("String_Node_Str" + this.id + "String_Node_Str"+ id);
  renderer.startAnimation(id,repeatType,count,cb);
  outAnim();
}

Fixed version (ground truth):
public void startAnimation(String id,Tween.Type repeatType,int count,ActionCallback cb){
  inAnim();
  if (posTween != null && posTween instanceof WalkTween)   posTween=null;
  EngineLogger.debug("String_Node_Str" + this.id + "String_Node_Str"+ id);
  renderer.startAnimation(id,repeatType,count,cb);
  outAnim(repeatType);
}
Program: 30223
Project: 30223
Buggy source:
@Override public boolean run(VerbRunner cb){
  MusicEngine musicEngine=World.getInstance().getMusicEngine();
  if (filename == null) {
    musicEngine.setMusic(null);
  }
 else {
    MusicDesc md=new MusicDesc();
    md.setFilename(filename);
    md.setLoop(loop);
    md.setInitialDelay(initialDelay);
    md.setRepeatDelay(repeatDelay);
    md.setStopWhenLeaving(stopWhenLeaving);
    musicEngine.setMusic(md);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  MusicEngine musicEngine=World.getInstance().getMusicEngine();
  if (filename == null) {
    musicEngine.setMusic(null);
  }
 else {
    MusicDesc md=new MusicDesc();
    md.setFilename(filename);
    md.setLoop(loop);
    md.setInitialDelay(initialDelay);
    md.setRepeatDelay(repeatDelay);
    md.setStopWhenLeaving(stopWhenLeaving);
    md.setVolume(volume);
    musicEngine.setMusic(md);
  }
  return false;
}
Program: 30224
Project: 30224
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  if (SerializationHelper.getInstance().getMode() == Mode.MODEL) {
    desc=json.readValue("String_Node_Str",String.class,jsonData);
    sounds=json.readValue("String_Node_Str",HashMap.class,SoundFX.class,jsonData);
    layer=json.readValue("String_Node_Str",String.class,jsonData);
  }
 else {
    playingSound=json.readValue("String_Node_Str",String.class,jsonData);
    playerInside=json.readValue("String_Node_Str",boolean.class,false,jsonData);
    String newLayer=json.readValue("String_Node_Str",String.class,jsonData);
    if (newLayer != null && !newLayer.equals(layer)) {
      scene.getLayer(layer).remove(this);
      scene.getLayer(newLayer).add(this);
      layer=newLayer;
    }
  }
  verbs.read(json,jsonData);
  interaction=json.readValue("String_Node_Str",boolean.class,interaction,jsonData);
  state=json.readValue("String_Node_Str",String.class,jsonData);
  zIndex=json.readValue("String_Node_Str",float.class,zIndex,jsonData);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  if (SerializationHelper.getInstance().getMode() == Mode.MODEL) {
    desc=json.readValue("String_Node_Str",String.class,jsonData);
    sounds=json.readValue("String_Node_Str",HashMap.class,SoundFX.class,jsonData);
    layer=json.readValue("String_Node_Str",String.class,jsonData);
  }
 else {
    playingSound=json.readValue("String_Node_Str",String.class,jsonData);
    if (playingSound != null && (sounds == null || sounds.get(playingSound) == null)) {
      EngineLogger.debug("String_Node_Str" + playingSound);
      playingSound=null;
    }
    playerInside=json.readValue("String_Node_Str",boolean.class,false,jsonData);
    String newLayer=json.readValue("String_Node_Str",String.class,jsonData);
    if (newLayer != null && !newLayer.equals(layer)) {
      scene.getLayer(layer).remove(this);
      scene.getLayer(newLayer).add(this);
      layer=newLayer;
    }
  }
  verbs.read(json,jsonData);
  interaction=json.readValue("String_Node_Str",boolean.class,interaction,jsonData);
  state=json.readValue("String_Node_Str",String.class,jsonData);
  zIndex=json.readValue("String_Node_Str",float.class,zIndex,jsonData);
}
Program: 30225
Project: 30225
Buggy source:
public MusicDesc(MusicDesc md){
  filename=md.getFilename();
  loop=md.isLoop();
  initialDelay=md.getInitialDelay();
  repeatDelay=md.getRepeatDelay();
  stopWhenLeaving=md.isStopWhenLeaving();
}

Fixed version (ground truth):
public MusicDesc(MusicDesc md){
  filename=md.getFilename();
  loop=md.isLoop();
  initialDelay=md.getInitialDelay();
  repeatDelay=md.getRepeatDelay();
  stopWhenLeaving=md.isStopWhenLeaving();
  volume=md.getVolume();
}
Program: 30226
Project: 30226
Buggy source:
public void setMusic(MusicDesc d){
  stopMusic();
  currentMusicDelay=0;
  if (d != null) {
    if (!d.getFilename().equals(desc.getFilename())) {
      dispose();
      desc=new MusicDesc(d);
      loadAssets();
      EngineAssetManager.getInstance().finishLoading();
      music=EngineAssetManager.getInstance().getMusic(desc.getFilename());
    }
 else {
      desc=new MusicDesc(d);
    }
  }
 else {
    dispose();
    desc=null;
  }
}

Fixed version (ground truth):
public void setMusic(MusicDesc d){
  stopMusic();
  currentMusicDelay=0;
  if (d != null) {
    if (desc != null)     dispose();
    desc=new MusicDesc(d);
    retrieveAssets();
  }
 else {
    dispose();
    desc=null;
  }
}
Program: 30227
Project: 30227
Buggy source:
public void leaveScene(MusicDesc newMusicDesc){
  if (newMusicDesc != null) {
    currentMusicDelay=0;
    stopMusic();
    dispose();
    desc=new MusicDesc(newMusicDesc);
  }
 else   if (music != null && desc.isStopWhenLeaving()) {
    currentMusicDelay=0;
    stopMusic();
    dispose();
    desc=null;
  }
}

Fixed version (ground truth):
public void leaveScene(MusicDesc newMusicDesc){
  if (desc != null && !desc.isStopWhenLeaving() && (newMusicDesc == null || newMusicDesc.getFilename().equals(desc.getFilename())))   return;
  if (desc != null) {
    currentMusicDelay=0;
    stopMusic();
    dispose();
  }
  if (newMusicDesc != null) {
    desc=new MusicDesc(newMusicDesc);
  }
 else {
    desc=null;
  }
}
Program: 30228
Project: 30228
Buggy source:
@Override public void retrieveAssets(){
  if (music == null && desc != null) {
    EngineLogger.debug("String_Node_Str" + desc.getFilename());
    music=EngineAssetManager.getInstance().getMusic(desc.getFilename());
    if (isPlayingSer) {
      if (music != null) {
        music.setPosition(musicPosSer);
        musicPosSer=0f;
      }
      playMusic();
      isPlayingSer=false;
    }
  }
}

Fixed version (ground truth):
@Override public void retrieveAssets(){
  if (music == null && desc != null) {
    if (!EngineAssetManager.getInstance().isLoaded(desc.getFilename())) {
      loadAssets();
      EngineAssetManager.getInstance().finishLoading();
    }
    EngineLogger.debug("String_Node_Str" + desc.getFilename());
    music=EngineAssetManager.getInstance().getMusic(desc.getFilename());
    music.setVolume(desc.getVolume());
    if (isPlayingSer) {
      if (music != null) {
        music.setPosition(musicPosSer);
        musicPosSer=0f;
      }
      playMusic();
      isPlayingSer=false;
    }
  }
}
Program: 30230
Project: 30230
Buggy source:
@Override public void write(Json json){
  super.write(json);
  if (SerializationHelper.getInstance().getMode() == Mode.MODEL) {
    json.writeValue("String_Node_Str",desc);
    json.writeValue("String_Node_Str",sounds,sounds == null ? null : sounds.getClass(),SoundFX.class);
  }
 else {
    json.writeValue("String_Node_Str",playingSound,playingSound == null ? null : playingSound.getClass());
    json.writeValue("String_Node_Str",playerInside);
  }
  verbs.write(json);
  json.writeValue("String_Node_Str",interaction);
  json.writeValue("String_Node_Str",state);
  json.writeValue("String_Node_Str",zIndex);
  json.writeValue("String_Node_Str",layer);
}

Fixed version (ground truth):
@Override public void write(Json json){
  super.write(json);
  if (SerializationHelper.getInstance().getMode() == Mode.MODEL) {
    json.writeValue("String_Node_Str",desc);
    json.writeValue("String_Node_Str",sounds,sounds == null ? null : sounds.getClass(),SoundFX.class);
  }
 else {
    json.writeValue("String_Node_Str",playingSound);
    json.writeValue("String_Node_Str",playerInside);
  }
  verbs.write(json);
  json.writeValue("String_Node_Str",interaction);
  json.writeValue("String_Node_Str",state);
  json.writeValue("String_Node_Str",zIndex);
  json.writeValue("String_Node_Str",layer);
}
Program: 30231
Project: 30231
Buggy source:
@Override public void dispose(){
  if (sounds != null) {
    for (    SoundFX s : sounds.values()) {
      s.dispose();
    }
    sounds.clear();
    sounds=null;
    playingSound=null;
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  if (sounds != null) {
    for (    SoundFX s : sounds.values()) {
      s.dispose();
    }
  }
}
Program: 30233
Project: 30233
Buggy source:
@Override public void run(){
  Message.showMsg(stage,"String_Node_Str",5);
  if (!RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str"))   Message.showMsg(stage,"String_Node_Str",4);
}

Fixed version (ground truth):
@Override public void run(){
  Message.showMsg(stage,"String_Node_Str",5);
  if (!RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str")) {
    Message.showMsg(stage,"String_Node_Str",4);
  }
  Ctx.project.getProjectConfig().remove(Config.CHAPTER_PROP);
  Ctx.project.getProjectConfig().remove(Config.TEST_SCENE_PROP);
  Ctx.project.setModified();
  try {
    Ctx.project.saveProject();
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage();
    EngineLogger.error(msg);
    return;
  }
}
Program: 30234
Project: 30234
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  if (Ctx.project.getSelectedScene() == null) {
    String msg="String_Node_Str";
    Message.showMsg(getStage(),msg,3);
    return;
  }
  Ctx.project.getProjectConfig().setProperty(Config.CHAPTER_PROP,Ctx.project.getChapter().getId());
  Ctx.project.getProjectConfig().setProperty(Config.TEST_SCENE_PROP,Ctx.project.getSelectedScene().getId());
  Ctx.project.setModified();
  try {
    Ctx.project.saveProject();
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage();
    Message.showMsgDialog(getStage(),"String_Node_Str",msg);
    return;
  }
  new Thread(new Runnable(){
    Stage stage=getStage();
    @Override public void run(){
      Message.showMsg(stage,"String_Node_Str",5);
      if (!RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str"))       Message.showMsg(stage,"String_Node_Str",4);
    }
  }
).start();
  Ctx.project.getProjectConfig().remove(Config.CHAPTER_PROP);
  Ctx.project.getProjectConfig().remove(Config.TEST_SCENE_PROP);
  Ctx.project.setModified();
  event.cancel();
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  if (Ctx.project.getSelectedScene() == null) {
    String msg="String_Node_Str";
    Message.showMsg(getStage(),msg,3);
    return;
  }
  Ctx.project.getProjectConfig().setProperty(Config.CHAPTER_PROP,Ctx.project.getChapter().getId());
  Ctx.project.getProjectConfig().setProperty(Config.TEST_SCENE_PROP,Ctx.project.getSelectedScene().getId());
  Ctx.project.setModified();
  try {
    Ctx.project.saveProject();
  }
 catch (  Exception ex) {
    String msg="String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage();
    Message.showMsgDialog(getStage(),"String_Node_Str",msg);
    return;
  }
  new Thread(new Runnable(){
    Stage stage=getStage();
    @Override public void run(){
      Message.showMsg(stage,"String_Node_Str",5);
      if (!RunProccess.runGradle(Ctx.project.getProjectDir(),"String_Node_Str")) {
        Message.showMsg(stage,"String_Node_Str",4);
      }
      Ctx.project.getProjectConfig().remove(Config.CHAPTER_PROP);
      Ctx.project.getProjectConfig().remove(Config.TEST_SCENE_PROP);
      Ctx.project.setModified();
      try {
        Ctx.project.saveProject();
      }
 catch (      Exception ex) {
        String msg="String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage();
        EngineLogger.error(msg);
        return;
      }
    }
  }
).start();
  event.cancel();
}
Program: 30235
Project: 30235
Buggy source:
@Override public void dispose(){
  for (  String key : sourceCache.keySet()) {
    EngineAssetManager.getInstance().disposeAtlas(key);
  }
  sourceCache.clear();
  currentSource=null;
  renderer=null;
  bounds=null;
}

Fixed version (ground truth):
@Override public void dispose(){
  for (  SkeletonCacheEntry entry : sourceCache.values()) {
    EngineAssetManager.getInstance().disposeAtlas(entry.atlas);
  }
  sourceCache.clear();
  currentSource=null;
  renderer=null;
  bounds=null;
}
Program: 30236
Project: 30236
Buggy source:
private void loadSource(String source,String atlas){
  SkeletonCacheEntry entry=sourceCache.get(source);
  if (entry == null) {
    entry=new SkeletonCacheEntry();
    entry.atlas=atlas;
    sourceCache.put(source,entry);
  }
  if (entry.refCounter == 0)   EngineAssetManager.getInstance().loadAtlas(atlas == null ? source : atlas);
  entry.refCounter++;
}

Fixed version (ground truth):
private void loadSource(String source,String atlas){
  SkeletonCacheEntry entry=sourceCache.get(source);
  if (entry == null) {
    entry=new SkeletonCacheEntry();
    entry.atlas=atlas == null ? source : atlas;
    sourceCache.put(source,entry);
  }
  if (entry.refCounter == 0)   EngineAssetManager.getInstance().loadAtlas(entry.atlas);
  entry.refCounter++;
}
Program: 30237
Project: 30237
Buggy source:
@Override public void dispose(){
  renderer.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  renderer.dispose();
}
Program: 30238
Project: 30238
Buggy source:
@Override public void retrieveAssets(){
  renderer.retrieveAssets();
  setPosition(bbox.getX(),bbox.getY());
  super.retrieveAssets();
}

Fixed version (ground truth):
@Override public void retrieveAssets(){
  super.retrieveAssets();
  renderer.retrieveAssets();
  setPosition(bbox.getX(),bbox.getY());
}
Program: 30239
Project: 30239
Buggy source:
@Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  startX=json.readValue("String_Node_Str",Float.class,jsonData);
  startY=json.readValue("String_Node_Str",Float.class,jsonData);
  targetX=json.readValue("String_Node_Str",Float.class,jsonData);
  targetY=json.readValue("String_Node_Str",Float.class,jsonData);
  interpolationX=json.readValue("String_Node_Str",Interpolation.class,jsonData);
  interpolationY=json.readValue("String_Node_Str",Interpolation.class,jsonData);
}

Fixed version (ground truth):
@Override public void read(Json json,JsonValue jsonData){
  super.read(json,jsonData);
  startX=json.readValue("String_Node_Str",Float.class,jsonData);
  startY=json.readValue("String_Node_Str",Float.class,jsonData);
  targetX=json.readValue("String_Node_Str",Float.class,jsonData);
  targetY=json.readValue("String_Node_Str",Float.class,jsonData);
  interpolationX=json.readValue("String_Node_Str",InterpolationMode.class,jsonData);
  interpolationY=json.readValue("String_Node_Str",InterpolationMode.class,jsonData);
}
Program: 30240
Project: 30240
Buggy source:
public void start(SpriteActor target,Tween.Type repeatType,int count,float tx,float ty,float duration,Interpolation interpolationX,Interpolation interpolationY,ActionCallback cb){
  startX=target.getX();
  startY=target.getY();
  targetX=tx;
  targetY=ty;
  setDuration(duration);
  setType(repeatType);
  setCount(count);
  this.interpolationX=interpolationX;
  this.interpolationY=interpolationY;
  if (cb != null) {
    setCb(cb);
  }
  restart();
}

Fixed version (ground truth):
public void start(SpriteActor target,Tween.Type repeatType,int count,float tx,float ty,float duration,InterpolationMode interpolationX,InterpolationMode interpolationY,ActionCallback cb){
  startX=target.getX();
  startY=target.getY();
  targetX=tx;
  targetY=ty;
  setDuration(duration);
  setType(repeatType);
  setCount(count);
  this.interpolationX=interpolationX;
  this.interpolationY=interpolationY;
  if (cb != null) {
    setCb(cb);
  }
  restart();
}
Program: 30241
Project: 30241
Buggy source:
@Override public void read(Json json,JsonValue jsonData){
  duration=json.readValue("String_Node_Str",Float.class,jsonData);
  time=json.readValue("String_Node_Str",Float.class,jsonData);
  ;
  reverse=json.readValue("String_Node_Str",Boolean.class,jsonData);
  began=json.readValue("String_Node_Str",Boolean.class,jsonData);
  complete=json.readValue("String_Node_Str",Boolean.class,jsonData);
  type=json.readValue("String_Node_Str",Type.class,jsonData);
  count=json.readValue("String_Node_Str",Integer.class,jsonData);
  interpolation=json.readValue("String_Node_Str",Interpolation.class,jsonData);
  String cbSer=json.readValue("String_Node_Str",String.class,jsonData);
  cb=ActionCallbackSerialization.find(cbSer);
}

Fixed version (ground truth):
@Override public void read(Json json,JsonValue jsonData){
  duration=json.readValue("String_Node_Str",Float.class,jsonData);
  time=json.readValue("String_Node_Str",Float.class,jsonData);
  reverse=json.readValue("String_Node_Str",Boolean.class,jsonData);
  began=json.readValue("String_Node_Str",Boolean.class,jsonData);
  complete=json.readValue("String_Node_Str",Boolean.class,jsonData);
  type=json.readValue("String_Node_Str",Type.class,jsonData);
  count=json.readValue("String_Node_Str",Integer.class,jsonData);
  interpolation=json.readValue("String_Node_Str",InterpolationMode.class,jsonData);
  String cbSer=json.readValue("String_Node_Str",String.class,jsonData);
  cb=ActionCallbackSerialization.find(cbSer);
}
Program: 30242
Project: 30242
Buggy source:
public void setInterpolation(InterpolationMode interpolation){
  this.interpolation=interpolation.getInterpolation();
}

Fixed version (ground truth):
public void setInterpolation(InterpolationMode i){
  interpolation=i;
}
Program: 30243
Project: 30243
Buggy source:
public float getPercent(Interpolation i){
  float percent;
  if (complete) {
    percent=1;
  }
 else {
    percent=time / duration;
    if (i != null)     percent=i.apply(percent);
  }
  return (reverse ? 1 - percent : percent);
}

Fixed version (ground truth):
public float getPercent(InterpolationMode i){
  float percent;
  if (complete) {
    percent=1;
  }
 else {
    percent=time / duration;
    if (i != null)     percent=i.getInterpolation().apply(percent);
  }
  return (reverse ? 1 - percent : percent);
}
Program: 30244
Project: 30244
Buggy source:
private void walkToNextStep(CharacterActor target){
  Vector2 p0=walkingPath.get(currentStep);
  Vector2 pf=walkingPath.get(currentStep + 1);
  target.startWalkAnim(p0,pf);
  float s0=target.getScene().getFakeDepthScale(p0.y);
  float sf=target.getScene().getFakeDepthScale(pf.y);
  float segmentDuration=p0.dst(pf) / (EngineAssetManager.getInstance().getScale() * speed * (s0 + sf) / 2);
  segmentDuration*=(s0 > sf ? s0 / sf : sf / s0);
  Interpolation i=Interpolation.linear;
  if (Math.abs(s0 - sf) > .25)   i=s0 > sf ? Interpolation.pow2Out : Interpolation.pow2In;
  if (currentStep == walkingPath.size() - 2 && walkCb != null) {
    start(target,Type.NO_REPEAT,1,pf.x,pf.y,segmentDuration,Interpolation.linear,i,walkCb);
  }
 else {
    start(target,Type.NO_REPEAT,1,pf.x,pf.y,segmentDuration,Interpolation.linear,i,null);
  }
}

Fixed version (ground truth):
private void walkToNextStep(CharacterActor target){
  Vector2 p0=walkingPath.get(currentStep);
  Vector2 pf=walkingPath.get(currentStep + 1);
  target.startWalkAnim(p0,pf);
  float s0=target.getScene().getFakeDepthScale(p0.y);
  float sf=target.getScene().getFakeDepthScale(pf.y);
  float segmentDuration=p0.dst(pf) / (EngineAssetManager.getInstance().getScale() * speed * (s0 + sf) / 2);
  segmentDuration*=(s0 > sf ? s0 / sf : sf / s0);
  InterpolationMode i=InterpolationMode.LINEAR;
  if (Math.abs(s0 - sf) > .25)   i=s0 > sf ? InterpolationMode.POW2OUT : InterpolationMode.POW2IN;
  if (currentStep == walkingPath.size() - 2 && walkCb != null) {
    start(target,Type.NO_REPEAT,1,pf.x,pf.y,segmentDuration,InterpolationMode.LINEAR,i,walkCb);
  }
 else {
    start(target,Type.NO_REPEAT,1,pf.x,pf.y,segmentDuration,InterpolationMode.LINEAR,i,null);
  }
}
Program: 30250
Project: 30250
Buggy source:
public void loadGameState(FileHandle savedFile) throws IOException {
  EngineLogger.debug("String_Node_Str");
  if (!disposed)   dispose();
  init();
  if (savedFile.exists()) {
    assetState=AssetState.LOAD_ASSETS;
    SerializationHelper.getInstance().setMode(Mode.STATE);
    JsonValue root=new JsonReader().parse(savedFile.reader("String_Node_Str"));
    Json json=new Json();
    json.setIgnoreUnknownFields(true);
    read(json,root);
  }
 else {
    throw new IOException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void loadGameState(FileHandle savedFile) throws IOException {
  EngineLogger.debug("String_Node_Str");
  if (!disposed)   dispose();
  init();
  if (savedFile.exists()) {
    SerializationHelper.getInstance().setMode(Mode.STATE);
    JsonValue root=new JsonReader().parse(savedFile.reader("String_Node_Str"));
    Json json=new Json();
    json.setIgnoreUnknownFields(true);
    read(json,root);
    assetState=AssetState.LOAD_ASSETS;
  }
 else {
    throw new IOException("String_Node_Str");
  }
}
Program: 30251
Project: 30251
Buggy source:
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new DialogOption();
    parent.addOption(e);
  }
  String key=e.getText();
  if (key == null || key.isEmpty() || key.charAt(0) != I18N.PREFIX)   key=Ctx.project.getI18N().genKey(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getId(),pos,"String_Node_Str");
  Ctx.project.getI18N().setTranslation(key,text.getText());
  if (text.getText() != null && !text.getText().isEmpty())   e.setText(key);
 else   e.setText(null);
  String responseKey=e.getResponseText();
  if (responseKey == null || responseKey.isEmpty() || responseKey.charAt(0) != I18N.PREFIX)   responseKey=Ctx.project.getI18N().genKey(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getId(),pos,"String_Node_Str");
  Ctx.project.getI18N().setTranslation(responseKey,responseText.getText());
  if (responseText.getText() != null && !responseText.getText().isEmpty())   e.setResponseText(responseKey);
 else   e.setResponseText(null);
  e.setVerbId(verb.getText());
  e.setNext(next.getText());
  e.setVisible(Boolean.parseBoolean(visible.getText()));
  e.setOnce(Boolean.parseBoolean(once.getText()));
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new DialogOption();
    parent.getOptions().add(pos,e);
  }
  String key=e.getText();
  if (key == null || key.isEmpty() || key.charAt(0) != I18N.PREFIX)   key=Ctx.project.getI18N().genKey(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getId(),pos,"String_Node_Str");
  Ctx.project.getI18N().setTranslation(key,text.getText());
  if (text.getText() != null && !text.getText().isEmpty())   e.setText(key);
 else   e.setText(null);
  String responseKey=e.getResponseText();
  if (responseKey == null || responseKey.isEmpty() || responseKey.charAt(0) != I18N.PREFIX)   responseKey=Ctx.project.getI18N().genKey(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getId(),pos,"String_Node_Str");
  Ctx.project.getI18N().setTranslation(responseKey,responseText.getText());
  if (responseText.getText() != null && !responseText.getText().isEmpty())   e.setResponseText(responseKey);
 else   e.setResponseText(null);
  e.setVerbId(verb.getText());
  e.setNext(next.getText());
  e.setVisible(Boolean.parseBoolean(visible.getText()));
  e.setOnce(Boolean.parseBoolean(once.getText()));
  Ctx.project.setModified();
}
Program: 30252
Project: 30252
Buggy source:
@Override protected void create(){
  EditOptionDialog dialog=(EditOptionDialog)getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex() + 1;
      DialogOption e=((EditOptionDialog)actor).getElement();
      list.getItems().insert(pos,e);
      list.setSelectedIndex(pos);
      list.invalidateHierarchy();
      if (pos != 0 && pos < list.getItems().size) {
        DialogOption e2=list.getItems().get(pos);
        parent.getOptions().set(pos,e);
        parent.getOptions().set(list.getItems().size - 1,e2);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void create(){
  EditOptionDialog dialog=(EditOptionDialog)getEditElementDialogInstance(null);
  dialog.show(getStage());
  dialog.setListener(new ChangeListener(){
    @Override public void changed(    ChangeEvent event,    Actor actor){
      int pos=list.getSelectedIndex() + 1;
      DialogOption e=((EditOptionDialog)actor).getElement();
      list.getItems().insert(pos,e);
      list.setSelectedIndex(pos);
      list.invalidateHierarchy();
    }
  }
);
}
Program: 30253
Project: 30253
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex() + 1;
  DialogOption e=((EditOptionDialog)actor).getElement();
  list.getItems().insert(pos,e);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  if (pos != 0 && pos < list.getItems().size) {
    DialogOption e2=list.getItems().get(pos);
    parent.getOptions().set(pos,e);
    parent.getOptions().set(list.getItems().size - 1,e2);
  }
}

Fixed version (ground truth):
@Override public void changed(ChangeEvent event,Actor actor){
  int pos=list.getSelectedIndex() + 1;
  DialogOption e=((EditOptionDialog)actor).getElement();
  list.getItems().insert(pos,e);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
}
Program: 30254
Project: 30254
Buggy source:
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new Dialog();
  }
 else {
    parent.getDialogs().remove(e.getId());
  }
  e.setId(ElementUtils.getCheckedId(id.getText(),parent.getDialogs().keySet().toArray(new String[0])));
  parent.addDialog(e);
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new Dialog();
  }
 else {
    parent.getDialogs().remove(e.getId());
  }
  if (parent.getDialogs() != null)   e.setId(ElementUtils.getCheckedId(id.getText(),parent.getDialogs().keySet().toArray(new String[0])));
 else   e.setId(id.getText());
  parent.addDialog(e);
  Ctx.project.setModified();
}
Program: 30255
Project: 30255
Buggy source:
public EditOptionDialog(Skin skin,Dialog parent,DialogOption e,int pos){
  super(skin);
  this.pos=e == null ? pos + 1 : pos;
  text=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Type.SMALL_TEXT,true);
  responseText=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Type.TEXT,false);
  verb=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str");
  next=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",getActorDialogs((CharacterActor)Ctx.project.getSelectedActor()),false);
  visible=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Param.Type.BOOLEAN,false);
  once=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Param.Type.BOOLEAN,false);
  setInfo("String_Node_Str");
  text.getCell(text.getField()).fillX();
  responseText.getCell(responseText.getField()).fillX();
  init(parent,e,new InputPanel[]{text,responseText,verb,next,visible,once});
}

Fixed version (ground truth):
public EditOptionDialog(Skin skin,Dialog parent,DialogOption e,int pos){
  super(skin);
  this.pos=e == null ? pos + 1 : pos;
  text=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Type.SMALL_TEXT,true);
  responseText=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Type.TEXT,false);
  verb=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str");
  next=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",getActorDialogs((CharacterActor)Ctx.project.getSelectedActor()),false);
  visible=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Param.Type.BOOLEAN,true,"String_Node_Str");
  once=InputPanelFactory.createInputPanel(skin,"String_Node_Str","String_Node_Str",Param.Type.BOOLEAN,false);
  setInfo("String_Node_Str");
  text.getCell(text.getField()).fillX();
  responseText.getCell(responseText.getField()).fillX();
  init(parent,e,new InputPanel[]{text,responseText,verb,next,visible,once});
}
Program: 30257
Project: 30257
Buggy source:
@Override public void draw(Batch batch,float alpha){
  batch.setColor(Color.WHITE);
  final TextManagerUIStyle style=getStyle(subtitle);
  if (subtitle.type == Text.Type.TALK) {
    if (style.talkBubble != null) {
      float scale=DPIUtils.getTouchMinSize() / 4 / style.talkBubble.getMinHeight();
      unprojectTmp.set(subtitle.x,subtitle.y,0);
      World.getInstance().getSceneCamera().scene2screen(getStage().getViewport(),unprojectTmp);
      float bubbleX=unprojectTmp.x - style.talkBubble.getMinWidth() * scale / 2;
      float bubbleY=getY() - style.talkBubble.getMinHeight() * scale + 2;
      if (bubbleX + style.talkBubble.getMinWidth() * scale < getX() + getWidth() && bubbleX > getX())       style.talkBubble.draw(batch,bubbleX,bubbleY,style.talkBubble.getMinWidth() * scale,style.talkBubble.getMinHeight() * scale);
    }
    if (style.talkBackground != null) {
      style.talkBackground.draw(batch,getX(),getY(),getWidth(),getHeight());
    }
  }
 else   if (subtitle.type == Text.Type.SUBTITLE) {
    if (style.rectBackground != null) {
      style.rectBackground.draw(batch,getX(),getY(),getWidth(),getHeight());
    }
  }
  style.font.draw(batch,layout,fontX,getY() + PADDING + layout.height);
}

Fixed version (ground truth):
@Override public void draw(Batch batch,float alpha){
  batch.setColor(Color.WHITE);
  final TextManagerUIStyle style=getStyle(subtitle);
  if (subtitle.type == Text.Type.TALK) {
    if (getX() < 0 || getX() > getStage().getViewport().getScreenWidth())     return;
    if (style.talkBubble != null) {
      float scale=DPIUtils.getTouchMinSize() / 4 / style.talkBubble.getMinHeight();
      float bubbleX=unprojectTmp.x - style.talkBubble.getMinWidth() * scale / 2;
      bubbleX=Math.max(bubbleX,getX() + PADDING);
      bubbleX=Math.min(bubbleX,getStage().getViewport().getScreenWidth() - PADDING);
      float bubbleY=getY() - style.talkBubble.getMinHeight() * scale + 2;
      style.talkBubble.draw(batch,bubbleX,bubbleY,style.talkBubble.getMinWidth() * scale,style.talkBubble.getMinHeight() * scale);
    }
    if (style.talkBackground != null) {
      style.talkBackground.draw(batch,getX(),getY(),getWidth(),getHeight());
    }
  }
 else   if (subtitle.type == Text.Type.SUBTITLE) {
    if (style.rectBackground != null) {
      style.rectBackground.draw(batch,getX(),getY(),getWidth(),getHeight());
    }
  }
  style.font.draw(batch,layout,fontX,getY() + PADDING + layout.height);
}
Program: 30258
Project: 30258
Buggy source:
@Override public String toString(){
  StringBuffer sb=new StringBuffer(super.toString());
  sb.append("String_Node_Str");
  for (  Animation a : currentSource.modelInstance.animations) {
    sb.append("String_Node_Str").append(a.id);
  }
  if (currentSource.controller.current != null)   sb.append("String_Node_Str").append(currentSource.controller.current.animation.id);
  sb.append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer sb=new StringBuffer(super.toString());
  sb.append("String_Node_Str");
  if (currentSource != null) {
    for (    Animation a : currentSource.modelInstance.animations) {
      sb.append("String_Node_Str").append(a.id);
    }
    if (currentSource.controller.current != null)     sb.append("String_Node_Str").append(currentSource.controller.current.animation.id);
  }
  sb.append("String_Node_Str");
  return sb.toString();
}
Program: 30259
Project: 30259
Buggy source:
private int deleteFirstActionNamed(int pos,String actionId){
  while (!(list.getItems().get(pos) instanceof AbstractControlAction || getOrCreateControlActionId((AbstractControlAction)list.getItems().get(pos)).equals(actionId)))   pos++;
  Action e2=list.getItems().removeIndex(pos);
  parent.getActions().remove(e2);
  return pos;
}

Fixed version (ground truth):
private int deleteFirstActionNamed(int pos,String actionId){
  while (!(list.getItems().get(pos) instanceof AbstractControlAction && getOrCreateControlActionId((AbstractControlAction)list.getItems().get(pos)).equals(actionId)))   pos++;
  Action e2=list.getItems().removeIndex(pos);
  parent.getActions().remove(e2);
  return pos;
}
Program: 30260
Project: 30260
Buggy source:
@Override public void read(Json json,JsonValue jsonData){
  visible=json.readValue("String_Node_Str",Boolean.class,jsonData);
  items.clear();
  JsonValue jsonValueActors=jsonData.get("String_Node_Str");
  SceneActorRef actorRef;
  for (int i=0; i < jsonValueActors.size; i++) {
    JsonValue jsonValueAct=jsonValueActors.get(i);
    actorRef=new SceneActorRef(jsonValueAct.name);
    Scene sourceScn=World.getInstance().getScene(actorRef.getSceneId());
    BaseActor actor=sourceScn.getActor(actorRef.getActorId(),false);
    actor.read(json,jsonValueAct);
    items.add((SpriteActor)actor);
  }
}

Fixed version (ground truth):
@Override public void read(Json json,JsonValue jsonData){
  visible=json.readValue("String_Node_Str",Boolean.class,jsonData);
  items.clear();
  JsonValue jsonValueActors=jsonData.get("String_Node_Str");
  SceneActorRef actorRef;
  for (int i=0; i < jsonValueActors.size; i++) {
    JsonValue jsonValueAct=jsonValueActors.get(i);
    actorRef=new SceneActorRef(jsonValueAct.name);
    Scene sourceScn=World.getInstance().getScene(actorRef.getSceneId());
    BaseActor actor=sourceScn.getActor(actorRef.getActorId(),false);
    sourceScn.removeActor(actor);
    addItem((SpriteActor)actor);
  }
  for (int i=0; i < jsonValueActors.size; i++) {
    JsonValue jsonValueAct=jsonValueActors.get(i);
    actorRef=new SceneActorRef(jsonValueAct.name);
    SpriteActor actor=items.get(i);
    actor.read(json,jsonValueAct);
  }
}
Program: 30261
Project: 30261
Buggy source:
@Override public void write(Json json){
  SceneActorRef actorRef;
  json.writeValue("String_Node_Str",visible);
  json.writeObjectStart("String_Node_Str");
  for (  SpriteActor a : items) {
    actorRef=new SceneActorRef(a.getInitScene(),a.getId());
    json.writeValue(actorRef.toString(),a);
  }
  json.writeObjectEnd();
}

Fixed version (ground truth):
@Override public void write(Json json){
  SceneActorRef actorRef;
  json.writeValue("String_Node_Str",visible);
  ;
  json.writeObjectStart("String_Node_Str");
  for (  SpriteActor a : items) {
    actorRef=new SceneActorRef(a.getInitScene(),a.getId());
    json.writeValue(actorRef.toString(),a);
  }
  json.writeObjectEnd();
}
Program: 30264
Project: 30264
Buggy source:
@Override protected void paste(){
  Scene newElement=(Scene)ElementUtils.cloneElement(clipboard);
  newElement.setId(ElementUtils.getCheckedId(newElement.getId(),World.getInstance().getScenes().keySet().toArray(new String[0])));
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  World.getInstance().addScene(newElement);
  Ctx.project.getI18N().extractStrings(newElement);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void paste(){
  Scene newElement=(Scene)ElementUtils.cloneElement(clipboard);
  newElement.setId(ElementUtils.getCheckedId(newElement.getId(),World.getInstance().getScenes().keySet().toArray(new String[0])));
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  World.getInstance().addScene(newElement);
  Ctx.project.getI18N().extractStrings(newElement);
  if (parent.getInitScene() == null) {
    parent.setInitScene(newElement.getId());
  }
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
}