nus-yam/ex-repair huggingface dataset:
Program: 30265
Project: 30265
Buggy source:
@Override protected void delete(){
  Scene s=removeSelected();
  parent.getScenes().remove(s.getId());
  if (parent.getInitScene().equals(s.getId())) {
    parent.setInitScene(null);
  }
  Ctx.project.getI18N().putTranslationsInElement(s);
  UndoOp undoOp=new UndoDeleteScene(s);
  Ctx.project.getUndoStack().add(undoOp);
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void delete(){
  Scene s=removeSelected();
  parent.getScenes().remove(s.getId());
  if (parent.getInitScene() != null && parent.getInitScene().equals(s.getId())) {
    if (parent.getScenes().size() > 0)     parent.setInitScene(parent.getScenes().values().iterator().next().getId());
 else     parent.setInitScene(null);
  }
  Ctx.project.getI18N().putTranslationsInElement(s);
  UndoOp undoOp=new UndoDeleteScene(s);
  Ctx.project.getUndoStack().add(undoOp);
  Ctx.project.setModified();
}
Program: 30266
Project: 30266
Buggy source:
protected T removeSelected(){
  int pos=list.getSelectedIndex();
  if (pos == -1)   return null;
  T e=list.getItems().removeIndex(pos);
  clipboard=e;
  if (pos > 0)   list.setSelectedIndex(pos - 1);
 else   if (pos == 0 && list.getItems().size > 0)   list.setSelectedIndex(0);
  toolbar.disablePaste(false);
  return e;
}

Fixed version (ground truth):
protected T removeSelected(){
  int pos=list.getSelectedIndex();
  if (pos == -1)   return null;
  T e=list.getItems().removeIndex(pos);
  clipboard=e;
  if (pos > 0)   list.setSelectedIndex(pos - 1);
 else   if (pos == 0 && list.getItems().size > 0)   list.setSelectedIndex(0);
 else   list.getSelection().clear();
  toolbar.disablePaste(false);
  return e;
}
Program: 30267
Project: 30267
Buggy source:
public static Action readJson(Json json,JsonValue jsonData){
  String className=jsonData.getString("String_Node_Str",null);
  Action action=null;
  if (className != null) {
    jsonData.remove("String_Node_Str");
    Class<?> clazz=null;
    try {
      clazz=ClassReflection.forName(className);
      action=(Action)clazz.newInstance();
    }
 catch (    ReflectionException|InstantiationException|IllegalAccessException ex) {
      throw new SerializationException(ex);
    }
    for (int j=0; j < jsonData.size; j++) {
      JsonValue v=jsonData.get(j);
      try {
        if (v.isNull())         ActionUtils.setParam(action,v.name,null);
 else         ActionUtils.setParam(action,v.name,v.asString());
      }
 catch (      NoSuchFieldException|IllegalArgumentException|IllegalAccessException e) {
        throw new SerializationException(e);
      }
    }
  }
  return action;
}

Fixed version (ground truth):
public static Action readJson(Json json,JsonValue jsonData){
  String className=jsonData.getString("String_Node_Str",null);
  Action action=null;
  if (className != null) {
    jsonData.remove("String_Node_Str");
    Class<?> clazz=null;
    try {
      clazz=ClassReflection.forName(className);
      action=(Action)clazz.newInstance();
    }
 catch (    ReflectionException|InstantiationException|IllegalAccessException ex) {
      throw new SerializationException(ex);
    }
    for (int j=0; j < jsonData.size; j++) {
      JsonValue v=jsonData.get(j);
      try {
        if (v.isNull())         ActionUtils.setParam(action,v.name,null);
 else         ActionUtils.setParam(action,v.name,v.asString());
      }
 catch (      NoSuchFieldException|IllegalArgumentException|IllegalAccessException e) {
        throw new SerializationException("String_Node_Str" + action.getClass().getCanonicalName() + "String_Node_Str"+ v.name,e);
      }
    }
  }
  return action;
}
Program: 30268
Project: 30268
Buggy source:
private void edit(){
  if (Desktop.isDesktopSupported()) {
    try {
      Desktop.getDesktop().open(new File(Ctx.project.getProjectDir().getAbsoluteFile() + "String_Node_Str"));
    }
 catch (    IOException e1) {
      String msg="String_Node_Str" + e1.getClass().getSimpleName() + "String_Node_Str"+ e1.getMessage();
      Message.showMsgDialog(getStage(),"String_Node_Str",msg);
    }
  }
}

Fixed version (ground truth):
private void edit(){
  if (Desktop.isDesktopSupported()) {
    String type=assetTypes.getSelected();
    String dir=getAssetDir(type);
    if (type.equals("String_Node_Str") || type.equals("String_Node_Str"))     dir+="String_Node_Str";
    try {
      Desktop.getDesktop().open(new File(dir));
    }
 catch (    IOException e1) {
      String msg="String_Node_Str" + e1.getClass().getSimpleName() + "String_Node_Str"+ e1.getMessage();
      Message.showMsgDialog(getStage(),"String_Node_Str",msg);
    }
  }
}
Program: 30270
Project: 30270
Buggy source:
@Override protected void paste(){
  Action newElement=(Action)ElementUtils.cloneElement(clipboard);
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  parent.getActions().add(pos,newElement);
  if (scope.equals(ScopePanel.WORLD_SCOPE))   Ctx.project.getI18N().extractStrings(null,null,parent.getHashKey(),pos,newElement);
 else   if (scope.equals(ScopePanel.SCENE_SCOPE))   Ctx.project.getI18N().extractStrings(Ctx.project.getSelectedScene().getId(),null,parent.getHashKey(),pos,newElement);
 else   Ctx.project.getI18N().extractStrings(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getHashKey(),pos,newElement);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
  if (isControlAction(newElement)) {
    try {
      ActionUtils.setParam(newElement,CONTROL_ACTION_ID_ATTR,null);
    }
 catch (    NoSuchFieldException|IllegalArgumentException|IllegalAccessException e) {
      EditorLogger.error(e.getMessage());
    }
    insertEndAction(pos + 1,getOrCreateControlActionId((AbstractControlAction)newElement));
  }
}

Fixed version (ground truth):
@Override protected void paste(){
  Action newElement=(Action)ElementUtils.cloneElement(clipboard);
  int pos=list.getSelectedIndex() + 1;
  list.getItems().insert(pos,newElement);
  parent.getActions().add(pos,newElement);
  if (scope.equals(ScopePanel.WORLD_SCOPE))   Ctx.project.getI18N().extractStrings(null,null,parent.getHashKey(),pos,newElement);
 else   if (scope.equals(ScopePanel.SCENE_SCOPE))   Ctx.project.getI18N().extractStrings(Ctx.project.getSelectedScene().getId(),null,parent.getHashKey(),pos,newElement);
 else   Ctx.project.getI18N().extractStrings(Ctx.project.getSelectedScene().getId(),Ctx.project.getSelectedActor().getId(),parent.getHashKey(),pos,newElement);
  list.setSelectedIndex(pos);
  list.invalidateHierarchy();
  Ctx.project.setModified();
  if (isControlAction(newElement)) {
    try {
      ActionUtils.setParam(newElement,CONTROL_ACTION_ID_ATTR,null);
    }
 catch (    NoSuchFieldException|IllegalArgumentException|IllegalAccessException e) {
      EditorLogger.error(e.getMessage());
    }
    insertEndAction(pos + 1,getOrCreateControlActionId((AbstractControlAction)newElement));
    if (newElement instanceof AbstractIfAction)     insertEndAction(pos + 2,getOrCreateControlActionId((AbstractControlAction)newElement));
  }
}
Program: 30272
Project: 30272
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")) {
        loadProject(projectFile);
      }
 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().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);
}
Program: 30273
Project: 30273
Buggy source:
public void layout(){
  final BitmapFont font=style.font;
  final Drawable selectedDrawable=style.selection;
  cellRenderer.layout(style);
  GlyphLayout textLayout=new GlyphLayout();
  prefWidth=0;
  for (int i=0; i < items.size; i++) {
    textLayout.setText(font,cellRenderer.getCellTitle(items.get(i)));
    prefWidth=Math.max(textLayout.width,prefWidth);
    if (cellRenderer.hasSubtitle()) {
      String subtitle=cellRenderer.getCellSubTitle(items.get(i));
      if (subtitle != null) {
        textLayout.setText(font,subtitle);
        prefWidth=Math.max(textLayout.width,prefWidth);
      }
    }
    if (cellRenderer.hasImage()) {
      TextureRegion r=cellRenderer.getCellImage(items.get(i));
      float ih=r.getRegionHeight();
      float iw=r.getRegionWidth();
      if (ih > getItemHeight() - 10) {
        ih=getItemHeight() - 10;
        iw*=ih / r.getRegionHeight();
      }
      prefWidth=Math.max(iw,prefWidth);
    }
  }
  prefWidth+=selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
  prefHeight=items.size * cellRenderer.getItemHeight();
  Drawable background=style.background;
  if (background != null) {
    prefWidth+=background.getLeftWidth() + background.getRightWidth();
    prefHeight+=background.getTopHeight() + background.getBottomHeight();
  }
}

Fixed version (ground truth):
public void layout(){
  final BitmapFont font=style.font;
  final BitmapFont subfont=style.subtitleFont;
  final Drawable selectedDrawable=style.selection;
  cellRenderer.layout(style);
  GlyphLayout textLayout=new GlyphLayout();
  prefWidth=0;
  for (int i=0; i < items.size; i++) {
    textLayout.setText(font,cellRenderer.getCellTitle(items.get(i)));
    prefWidth=Math.max(textLayout.width,prefWidth);
    if (cellRenderer.hasImage()) {
      TextureRegion r=cellRenderer.getCellImage(items.get(i));
      float ih=r.getRegionHeight();
      float iw=r.getRegionWidth();
      if (ih > getItemHeight() - 10) {
        ih=getItemHeight() - 10;
        iw*=ih / r.getRegionHeight();
      }
      prefWidth=Math.max(iw + textLayout.width,prefWidth);
    }
    if (cellRenderer.hasSubtitle()) {
      String subtitle=cellRenderer.getCellSubTitle(items.get(i));
      if (subtitle != null) {
        textLayout.setText(subfont,subtitle);
        prefWidth=Math.max(textLayout.width,prefWidth);
      }
    }
  }
  prefWidth+=selectedDrawable.getLeftWidth() + selectedDrawable.getRightWidth();
  prefHeight=items.size * cellRenderer.getItemHeight();
  Drawable background=style.background;
  if (background != null) {
    prefWidth+=background.getLeftWidth() + background.getRightWidth();
    prefHeight+=background.getTopHeight() + background.getBottomHeight();
  }
}
Program: 30274
Project: 30274
Buggy source:
protected void init(PARENT parent,T e,InputPanel[] inputs){
  this.e=e;
  this.parent=parent;
  this.i=inputs;
  getCenterPanel().clear();
  for (  InputPanel i : inputs) {
    addInputPanel(i);
  }
  if (e == null) {
    setTitle("String_Node_Str");
  }
 else {
    setTitle("String_Node_Str" + e.getClass().getSimpleName());
    try {
      modelToInputs();
    }
 catch (    Exception e1) {
      Message.showMsg(getStage(),"String_Node_Str" + e1.getMessage(),4);
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
protected void init(PARENT parent,T e,InputPanel[] inputs){
  this.e=e;
  this.parent=parent;
  this.i=inputs;
  getCenterPanel().clear();
  for (  InputPanel i : inputs) {
    addInputPanel(i);
  }
  if (e == null) {
    setTitle("String_Node_Str");
  }
 else {
    setTitle("String_Node_Str" + e.getClass().getSimpleName());
    try {
      modelToInputs();
    }
 catch (    Exception e1) {
      EditorLogger.error(e1.getMessage());
      e1.printStackTrace();
    }
  }
}
Program: 30275
Project: 30275
Buggy source:
public void setText(String s){
  input.setText(s.replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void setText(String s){
  if (s == null)   s="String_Node_Str";
  input.setText(s.replaceAll("String_Node_Str","String_Node_Str"));
}
Program: 30276
Project: 30276
Buggy source:
@Override public void changed(ChangeEvent event,Actor actor){
  setPlayer();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void changed(ChangeEvent event,Actor actor){
  BaseActor e=((EditModelDialog<Scene,BaseActor>)actor).getElement();
  if (e != list.getSelected()) {
    int i=list.getSelectedIndex();
    getItems().set(i,e);
    list.setSelectedIndex(i);
    list.invalidateHierarchy();
  }
}
Program: 30277
Project: 30277
Buggy source:
@Override public boolean run(ActionCallback cb){
  setVerbCb(cb);
  World w=World.getInstance();
  DialogOption o=World.getInstance().getCurrentDialog().getCurrentOption();
  String playerText=o.getText();
  responseText=o.getResponseText();
  characterName=w.getCurrentDialog().getActor();
  characterTurn=true;
  previousAnim=null;
  restoreStandPose(w.getCurrentScene().getPlayer());
  if (w.getCurrentScene().getActor(characterName,false) instanceof SpriteActor)   restoreStandPose((CharacterActor)w.getCurrentScene().getActor(characterName,false));
  if (playerText != null) {
    CharacterActor player=World.getInstance().getCurrentScene().getPlayer();
    World.getInstance().getTextManager().addText(playerText,player.getX(),player.getY() + player.getHeight(),false,Text.Type.TALK,player.getTextColor(),null,this);
    startTalkAnim(player);
  }
 else {
    resume();
  }
  return getWait();
}

Fixed version (ground truth):
@Override public boolean run(ActionCallback cb){
  setVerbCb(cb);
  World w=World.getInstance();
  DialogOption o=w.getCurrentDialog().getCurrentOption();
  String playerText=o.getText();
  responseText=o.getResponseText();
  characterName=w.getCurrentDialog().getActor();
  characterTurn=true;
  previousAnim=null;
  restoreStandPose(w.getCurrentScene().getPlayer());
  if (w.getCurrentScene().getActor(characterName,false) instanceof SpriteActor)   restoreStandPose((CharacterActor)w.getCurrentScene().getActor(characterName,false));
  if (playerText != null) {
    CharacterActor player=w.getCurrentScene().getPlayer();
    w.getTextManager().addText(playerText,player.getX(),player.getY() + player.getHeight(),false,Text.Type.TALK,player.getTextColor(),null,this);
    startTalkAnim(player);
  }
 else {
    resume();
  }
  return getWait();
}
Program: 30278
Project: 30278
Buggy source:
public void setCurrentDialog(Dialog dialog){
  this.currentDialog=dialog;
  if (dialog != null) {
    dialog.reset();
    int visibleOptions=dialog.getNumVisibleOptions();
    if (visibleOptions == 0)     currentDialog=null;
 else     if (visibleOptions == 1) {
      selectVisibleDialogOption(0);
    }
  }
}

Fixed version (ground truth):
public void setCurrentDialog(Dialog dialog){
  this.currentDialog=dialog;
  if (dialog != null) {
    dialog.reset();
    int visibleOptions=dialog.getNumVisibleOptions();
    if (visibleOptions == 0)     currentDialog=null;
  }
}
Program: 30279
Project: 30279
Buggy source:
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new Verb();
  }
  e.setId(id.getText());
  e.setState(state.getText());
  e.setTarget(target.getText());
  if (create) {
    parent.addVerb(e);
  }
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void inputsToModel(boolean create){
  if (create) {
    e=new Verb();
  }
 else {
    HashMap<String,Verb> verbs=parent.getVerbs();
    verbs.remove(e.getHashKey());
  }
  e.setId(id.getText());
  e.setState(state.getText());
  e.setTarget(target.getText());
  parent.addVerb(e);
  Ctx.project.setModified();
}
Program: 30280
Project: 30280
Buggy source:
public FileInputPanel(Skin skin,String title,String desc,File current,final DialogType dialogType){
  init(skin,title,desc,new TextButton(dialogType == DialogType.DIRECTORY ? DIR_TEXT : FILE_TEXT,skin),true,null);
  this.cd=current;
  ((TextButton)getField()).addListener(new ClickListener(){
    public void clicked(    InputEvent event,    float x,    float y){
      Platform.runLater(new Runnable(){
        @Override public void run(){
          final File result;
switch (dialogType) {
case DIRECTORY:
{
              DirectoryChooser chooser=new DirectoryChooser();
              chooser.setTitle(DIR_TEXT);
              result=chooser.showDialog(null);
              break;
            }
case OPEN_FILE:
case SAVE_FILE:
{
            FileChooser chooser=new FileChooser();
            chooser.setInitialDirectory(cd);
            chooser.setTitle(FILE_TEXT);
            result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
            break;
          }
default :
        throw new RuntimeException("String_Node_Str");
    }
    if (result != null) {
      ((TextButton)getField()).setText(result.getAbsolutePath());
      selected=cd=result;
    }
  }
}
);
}
}
);
}

Fixed version (ground truth):
public FileInputPanel(Skin skin,String title,String desc,File current,final DialogType dialogType){
  init(skin,title,desc,new TextButton(dialogType == DialogType.DIRECTORY ? DIR_TEXT : FILE_TEXT,skin),true,null);
  this.cd=current;
  ((TextButton)getField()).addListener(new ClickListener(){
    public void clicked(    InputEvent event,    float x,    float y){
      Platform.runLater(new Runnable(){
        @Override public void run(){
          final File result;
switch (dialogType) {
case DIRECTORY:
{
              DirectoryChooser chooser=new DirectoryChooser();
              chooser.setTitle(DIR_TEXT);
              result=chooser.showDialog(null);
              break;
            }
case OPEN_FILE:
case SAVE_FILE:
{
            FileChooser chooser=new FileChooser();
            chooser.setTitle(FILE_TEXT);
            result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
            break;
          }
default :
        throw new RuntimeException("String_Node_Str");
    }
    if (result != null) {
      ((TextButton)getField()).setText(result.getAbsolutePath());
      selected=cd=result;
    }
  }
}
);
}
}
);
}
Program: 30281
Project: 30281
Buggy source:
@Override public void run(){
  final File result;
switch (dialogType) {
case DIRECTORY:
{
      DirectoryChooser chooser=new DirectoryChooser();
      chooser.setTitle(DIR_TEXT);
      result=chooser.showDialog(null);
      break;
    }
case OPEN_FILE:
case SAVE_FILE:
{
    FileChooser chooser=new FileChooser();
    chooser.setInitialDirectory(cd);
    chooser.setTitle(FILE_TEXT);
    result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
    break;
  }
default :
throw new RuntimeException("String_Node_Str");
}
if (result != null) {
((TextButton)getField()).setText(result.getAbsolutePath());
selected=cd=result;
}
}

Fixed version (ground truth):
@Override public void run(){
  final File result;
switch (dialogType) {
case DIRECTORY:
{
      DirectoryChooser chooser=new DirectoryChooser();
      chooser.setTitle(DIR_TEXT);
      result=chooser.showDialog(null);
      break;
    }
case OPEN_FILE:
case SAVE_FILE:
{
    FileChooser chooser=new FileChooser();
    chooser.setTitle(FILE_TEXT);
    result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
    break;
  }
default :
throw new RuntimeException("String_Node_Str");
}
if (result != null) {
((TextButton)getField()).setText(result.getAbsolutePath());
selected=cd=result;
}
}
Program: 30282
Project: 30282
Buggy source:
public void clicked(InputEvent event,float x,float y){
  Platform.runLater(new Runnable(){
    @Override public void run(){
      final File result;
switch (dialogType) {
case DIRECTORY:
{
          DirectoryChooser chooser=new DirectoryChooser();
          chooser.setTitle(DIR_TEXT);
          result=chooser.showDialog(null);
          break;
        }
case OPEN_FILE:
case SAVE_FILE:
{
        FileChooser chooser=new FileChooser();
        chooser.setInitialDirectory(cd);
        chooser.setTitle(FILE_TEXT);
        result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
        break;
      }
default :
    throw new RuntimeException("String_Node_Str");
}
if (result != null) {
  ((TextButton)getField()).setText(result.getAbsolutePath());
  selected=cd=result;
}
}
}
);
}

Fixed version (ground truth):
public void clicked(InputEvent event,float x,float y){
  Platform.runLater(new Runnable(){
    @Override public void run(){
      final File result;
switch (dialogType) {
case DIRECTORY:
{
          DirectoryChooser chooser=new DirectoryChooser();
          chooser.setTitle(DIR_TEXT);
          result=chooser.showDialog(null);
          break;
        }
case OPEN_FILE:
case SAVE_FILE:
{
        FileChooser chooser=new FileChooser();
        chooser.setTitle(FILE_TEXT);
        result=dialogType == DialogType.OPEN_FILE ? chooser.showOpenDialog(null) : chooser.showSaveDialog(null);
        break;
      }
default :
    throw new RuntimeException("String_Node_Str");
}
if (result != null) {
  ((TextButton)getField()).setText(result.getAbsolutePath());
  selected=cd=result;
}
}
}
);
}
Program: 30283
Project: 30283
Buggy source:
public void setSelectedActor(BaseActor actor){
  BaseActor a=null;
  if (scn != null && actor != null) {
    a=actor;
  }
  selectedActor=a;
  faRenderer.setActor(a);
  setAnimation(null);
}

Fixed version (ground truth):
public void setSelectedActor(BaseActor actor){
  BaseActor a=null;
  if (scn != null && actor != null) {
    a=actor;
  }
  selectedActor=a;
  setAnimationRenderer(null,null);
}
Program: 30284
Project: 30284
Buggy source:
@Override public void act(float delta){
  if (projectLoadedFlag) {
    projectLoadedFlag=false;
    if (scn != null) {
      scn.dispose();
      scn=null;
    }
    setSelectedScene(Ctx.project.getSelectedScene());
    setSelectedActor(Ctx.project.getSelectedActor());
    setSelectedFA(Ctx.project.getSelectedFA());
  }
  if (scn != null && !loading && !loadingError) {
    if (!inScene)     faRenderer.update(delta);
    for (    SceneLayer layer : scn.getLayers())     layer.update();
    if (animation) {
      for (      BaseActor a : scn.getActors().values()) {
        a.update(delta);
      }
    }
    handleKeyPositioning();
  }
}

Fixed version (ground truth):
@Override public void act(float delta){
  if (projectLoadedFlag) {
    projectLoadedFlag=false;
    if (scn != null) {
      scn.dispose();
      scn=null;
    }
    setSelectedScene(Ctx.project.getSelectedScene());
    setSelectedActor(Ctx.project.getSelectedActor());
    setSelectedFA(Ctx.project.getSelectedFA());
  }
  if (scn != null && !loading && !loadingError) {
    if (!inScene)     faRenderer.update(delta);
    for (    SceneLayer layer : scn.getLayers())     layer.update();
    if (animation) {
      for (      BaseActor a : scn.getActors().values()) {
        boolean v=a.isVisible();
        a.setVisible(true);
        a.update(delta);
        a.setVisible(v);
      }
    }
    handleKeyPositioning();
  }
}
Program: 30285
Project: 30285
Buggy source:
@Override public void propertyChange(PropertyChangeEvent e){
  EditorLogger.debug("String_Node_Str" + e.getPropertyName());
  if (e.getPropertyName().equals(Project.NOTIFY_SCENE_SELECTED)) {
    if (!projectLoadedFlag)     setSelectedScene(Ctx.project.getSelectedScene());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_ACTOR_SELECTED)) {
    if (!projectLoadedFlag)     setSelectedActor(Ctx.project.getSelectedActor());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_ANIM_SELECTED)) {
    if (!projectLoadedFlag)     setSelectedFA(Ctx.project.getSelectedFA());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_PROJECT_LOADED)) {
    projectLoadedFlag=true;
  }
 else   if (e.getPropertyName().equals("String_Node_Str")) {
    setSelectedScene(Ctx.project.getSelectedScene());
    setSelectedActor(Ctx.project.getSelectedActor());
  }
 else   if (e.getPropertyName().equals("String_Node_Str")) {
    if (!inScene)     setSelectedFA(null);
  }
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent e){
  EditorLogger.debug("String_Node_Str" + e.getPropertyName());
  if (e.getPropertyName().equals(Project.NOTIFY_SCENE_SELECTED)) {
    if (!projectLoadedFlag)     setSelectedScene(Ctx.project.getSelectedScene());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_ACTOR_SELECTED)) {
    if (!projectLoadedFlag)     setSelectedActor(Ctx.project.getSelectedActor());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_ANIM_SELECTED)) {
    if (!projectLoadedFlag && Ctx.project.getSelectedFA() != null)     setSelectedFA(Ctx.project.getSelectedFA());
  }
 else   if (e.getPropertyName().equals(Project.NOTIFY_PROJECT_LOADED)) {
    projectLoadedFlag=true;
  }
 else   if (e.getPropertyName().equals("String_Node_Str")) {
    setSelectedScene(Ctx.project.getSelectedScene());
    setSelectedActor(Ctx.project.getSelectedActor());
  }
 else   if (e.getPropertyName().equals("String_Node_Str")) {
    if (!inScene)     setSelectedFA(null);
  }
}
Program: 30286
Project: 30286
Buggy source:
public void setSelectedFA(String selFA){
  if (selectedActor instanceof SpriteActor) {
    ActorRenderer s=((SpriteActor)selectedActor).getRenderer();
    if (selFA == null || (s.getAnimations().get(selFA) == null && s.getAnimations().get(AnimationDesc.getFlipId(selFA)) == null)) {
      selFA=((SpriteActor)selectedActor).getRenderer().getInitAnimation();
    }
    if (selFA != null && (s.getAnimations().get(selFA) != null || s.getAnimations().get(AnimationDesc.getFlipId(selFA)) != null)) {
      setAnimation(s.getAnimations().get(selFA));
      if (inScene || s.getCurrentAnimation() == null || ((SpriteActor)selectedActor).getRenderer().getInitAnimation().equals(selFA)) {
        try {
          ((SpriteActor)selectedActor).startAnimation(selFA,Tween.Type.REPEAT,Tween.INFINITY,null);
        }
 catch (        Exception e) {
          setAnimation(null);
          ((SpriteActor)selectedActor).getRenderer().getAnimations().remove(selFA);
        }
      }
    }
 else {
      setAnimation(null);
    }
  }
 else {
    setAnimation(null);
  }
}

Fixed version (ground truth):
public void setSelectedFA(String selFA){
  if (selectedActor instanceof SpriteActor) {
    ActorRenderer s=((SpriteActor)selectedActor).getRenderer();
    if (selFA == null || (s.getAnimations().get(selFA) == null && s.getAnimations().get(AnimationDesc.getFlipId(selFA)) == null)) {
      selFA=((SpriteActor)selectedActor).getRenderer().getInitAnimation();
    }
    if (selFA != null && (s.getAnimations().get(selFA) != null || s.getAnimations().get(AnimationDesc.getFlipId(selFA)) != null)) {
      setAnimationRenderer(selectedActor,s.getAnimations().get(selFA));
      if (inScene || s.getCurrentAnimation() == null || ((SpriteActor)selectedActor).getRenderer().getInitAnimation().equals(selFA)) {
        try {
          ((SpriteActor)selectedActor).startAnimation(selFA,Tween.Type.REPEAT,Tween.INFINITY,null);
        }
 catch (        Exception e) {
          setAnimationRenderer(selectedActor,null);
          ((SpriteActor)selectedActor).getRenderer().getAnimations().remove(selFA);
        }
      }
    }
 else {
      setAnimationRenderer(selectedActor,null);
    }
  }
 else {
    setAnimationRenderer(selectedActor,null);
  }
}
Program: 30288
Project: 30288
Buggy source:
public void setAnimation(AnimationDesc fa){
  try {
    faRenderer.setAnimation(fa);
  }
 catch (  Exception e) {
    Ctx.msg.show(getStage(),"String_Node_Str" + fa.id,4);
    e.printStackTrace();
    faRenderer.setAnimation(null);
  }
}

Fixed version (ground truth):
public void setAnimation(boolean v){
  animation=v;
}
Program: 30292
Project: 30292
Buggy source:
@Override protected void inputsToModel(boolean create){
  String sourceStr=source.getText();
  if (create) {
    ActorRenderer renderer=parent.getRenderer();
    if (renderer instanceof SpineRenderer) {
      e=new SpineAnimationDesc();
      if (spineAtlasExists(sourceStr)) {
        ((SpineAnimationDesc)e).atlas=null;
        setVisible(atlas,false);
      }
 else {
        if (!atlas.isVisible()) {
          setVisible(atlas,true);
        }
        ((SpineAnimationDesc)e).atlas=atlas.getText();
      }
    }
 else     if (renderer instanceof AtlasRenderer) {
      e=new AtlasAnimationDesc();
    }
 else {
      e=new AnimationDesc();
    }
  }
  e.id=id.getText();
  e.sound=sound.getText();
  e.source=sourceStr;
  e.count=Integer.parseInt(count.getText());
  e.preload=Boolean.parseBoolean(preload.getText());
  e.disposeWhenPlayed=Boolean.parseBoolean(dispose.getText());
  e.animationType=Type.valueOf(repeat.getText());
  e.inD=Param.parseVector2(in.getText());
  e.outD=Param.parseVector2(out.getText());
  e.duration=Float.parseFloat(speed.getText());
  if (delay.getText() == null || delay.getText().isEmpty())   e.delay=Float.parseFloat(delay.getText());
  if (create) {
    parent.getRenderer().getAnimations().put(e.id,e);
  }
  Ctx.project.setModified();
}

Fixed version (ground truth):
@Override protected void inputsToModel(boolean create){
  String sourceStr=source.getText();
  if (create) {
    ActorRenderer renderer=parent.getRenderer();
    if (renderer instanceof SpineRenderer) {
      e=new SpineAnimationDesc();
      if (spineAtlasExists(sourceStr)) {
        ((SpineAnimationDesc)e).atlas=null;
        setVisible(atlas,false);
      }
 else {
        if (!atlas.isVisible()) {
          setVisible(atlas,true);
        }
        ((SpineAnimationDesc)e).atlas=atlas.getText();
      }
    }
 else     if (renderer instanceof AtlasRenderer) {
      e=new AtlasAnimationDesc();
    }
 else {
      e=new AnimationDesc();
    }
  }
  e.id=id.getText();
  e.sound=sound.getText();
  e.source=sourceStr;
  e.count=Integer.parseInt(count.getText());
  e.preload=Boolean.parseBoolean(preload.getText());
  e.disposeWhenPlayed=Boolean.parseBoolean(dispose.getText());
  e.animationType=Type.valueOf(repeat.getText());
  e.inD=Param.parseVector2(in.getText());
  e.outD=Param.parseVector2(out.getText());
  e.duration=Float.parseFloat(speed.getText());
  if (delay.getText() == null || delay.getText().isEmpty())   e.delay=Float.parseFloat(delay.getText());
  if (create) {
    parent.getRenderer().addAnimation(e);
  }
  Ctx.project.setModified();
}
Program: 30293
Project: 30293
Buggy source:
@Override protected void modelToInputs(){
  source.setText(e.source);
  if (atlas.isVisible() && e instanceof SpineAnimationDesc)   atlas.setText(((SpineAnimationDesc)e).atlas);
  id.setText(e.id);
  repeat.setText(e.animationType.toString());
  speed.setText(Float.toString(e.duration));
  delay.setText(Float.toString(e.delay));
  count.setText(Integer.toString(e.count));
  in.setText(Param.toStringParam(e.inD));
  out.setText(Param.toStringParam(e.outD));
  sound.setText(e.sound);
  preload.setText(Boolean.toString(e.preload));
  dispose.setText(Boolean.toString(e.disposeWhenPlayed));
}

Fixed version (ground truth):
@Override protected void modelToInputs(){
  source.setText(e.source);
  if (atlas.isVisible() && e instanceof SpineAnimationDesc)   atlas.setText(((SpineAnimationDesc)e).atlas);
  id.setText(e.id);
  repeat.setText(e.animationType.toString());
  speed.setText(Float.toString(e.duration));
  delay.setText(Float.toString(e.delay));
  count.setText(Integer.toString(e.count));
  in.setText(Param.toStringParam(e.inD));
  out.setText(Param.toStringParam(e.outD));
  sound.setText(e.sound);
  preload.setText(Boolean.toString(e.preload));
  dispose.setText(Boolean.toString(e.disposeWhenPlayed));
  showHideFieldsDelayCountFields();
}
Program: 30294
Project: 30294
Buggy source:
protected void init(PARENT parent,T e,InputPanel[] inputs){
  this.e=e;
  this.parent=parent;
  this.i=inputs;
  getCenterPanel().clear();
  for (  InputPanel i : inputs) {
    addInputPanel(i);
  }
  if (e == null) {
    setTitle("String_Node_Str");
  }
 else {
    setTitle("String_Node_Str" + e.getClass().getSimpleName());
    modelToInputs();
  }
}

Fixed version (ground truth):
protected void init(PARENT parent,T e,InputPanel[] inputs){
  this.e=e;
  this.parent=parent;
  this.i=inputs;
  getCenterPanel().clear();
  for (  InputPanel i : inputs) {
    addInputPanel(i);
  }
  if (e == null) {
    setTitle("String_Node_Str");
  }
 else {
    setTitle("String_Node_Str" + e.getClass().getSimpleName());
    try {
      modelToInputs();
    }
 catch (    Exception e1) {
      Ctx.msg.show(getStage(),"String_Node_Str" + e1.getMessage(),4);
    }
  }
}
Program: 30295
Project: 30295
Buggy source:
@Override protected void ok(){
  inputsToModel(e == null);
  if (listener != null)   listener.changed(new ChangeEvent(),this);
}

Fixed version (ground truth):
@Override protected void ok(){
  try {
    inputsToModel(e == null);
  }
 catch (  Exception e1) {
    Ctx.msg.show(getStage(),"String_Node_Str" + e1.getMessage(),4);
  }
  if (listener != null)   listener.changed(new ChangeEvent(),this);
}
Program: 30296
Project: 30296
Buggy source:
/** 
 * Execute the action
 * @param cb
 * @return If 'true', the verb must stops the execution and waitfor the action to call the cb.resume()
 */
public boolean run(ActionCallback cb);

Fixed version (ground truth):
/** 
 * Execute the action
 * @param cb
 * @return If 'true', the verb must stops the execution and waitfor the action to call the cb.resume()
 */
public boolean run(VerbRunner cb);
Program: 30297
Project: 30297
Buggy source:
@Override public boolean run(ActionCallback cb){
  EngineLogger.debug(MessageFormat.format("String_Node_Str",animation.getAnimationId()));
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)World.getInstance().getCurrentScene().getActor(actorId,true);
  a.startAnimation(animation.getAnimationId(),repeat,count,wait ? cb : null);
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  EngineLogger.debug(MessageFormat.format("String_Node_Str",animation.getAnimationId()));
  String actorId=animation.getActorId();
  SpriteActor a=(SpriteActor)World.getInstance().getCurrentScene().getActor(actorId,true);
  a.startAnimation(animation.getAnimationId(),repeat,count,wait ? cb : null);
  return wait;
}
Program: 30298
Project: 30298
Buggy source:
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  SceneCamera camera=World.getInstance().getSceneCamera();
  if (zoom == -1)   zoom=camera.getZoom();
  if (pos == null) {
    pos=camera.getPosition();
    pos.x/=scale;
    pos.y/=scale;
  }
  if (followActor != null) {
    if (followActor.equals("String_Node_Str"))     World.getInstance().getCurrentScene().setCameraFollowActor(null);
 else     camera.updatePos((SpriteActor)World.getInstance().getCurrentScene().getActor(followActor,false));
  }
  if (duration == 0) {
    camera.setZoom(zoom);
    camera.setPosition(pos.x * scale,pos.y * scale);
    return false;
  }
 else {
    camera.startAnimation(pos.x * scale,pos.y * scale,zoom,duration,wait ? cb : null);
  }
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  float scale=EngineAssetManager.getInstance().getScale();
  SceneCamera camera=World.getInstance().getSceneCamera();
  if (zoom == -1)   zoom=camera.getZoom();
  if (pos == null) {
    pos=camera.getPosition();
    pos.x/=scale;
    pos.y/=scale;
  }
  if (followActor != null) {
    if (followActor.equals("String_Node_Str"))     World.getInstance().getCurrentScene().setCameraFollowActor(null);
 else     camera.updatePos((SpriteActor)World.getInstance().getCurrentScene().getActor(followActor,false));
  }
  if (duration == 0) {
    camera.setZoom(zoom);
    camera.setPosition(pos.x * scale,pos.y * scale);
    return false;
  }
 else {
    camera.startAnimation(pos.x * scale,pos.y * scale,zoom,duration,wait ? cb : null);
  }
  return wait;
}
Program: 30299
Project: 30299
Buggy source:
@Override public boolean run(ActionCallback 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();
 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=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();
 else   EngineLogger.error("String_Node_Str" + verb + "String_Node_Str"+ actor);
  return false;
}
Program: 30300
Project: 30300
Buggy source:
@Override public boolean run(ActionCallback cb){
  VerbRunner v=(VerbRunner)cb;
  int startIp=v.getIP();
  int ip0=startIp + 1;
  final List<Action> actions=v.getActions();
  int ip=skipControlIdBlock(actions,startIp);
  int numActions=ip - startIp - 1;
  if (numActions <= 0)   return false;
switch (chooseCriteria) {
case ITERATE:
    chooseCount++;
  break;
case RANDOM:
chooseCount=MathUtils.random(0,numActions - 1);
break;
case CYCLE:
chooseCount=(chooseCount + 1) % numActions;
break;
}
v.setIP(ip);
if (chooseCount < numActions) {
return actions.get(ip0 + chooseCount).run(v);
}
return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  VerbRunner v=(VerbRunner)cb;
  int startIp=v.getIP();
  int ip0=startIp + 1;
  final List<Action> actions=v.getActions();
  int ip=skipControlIdBlock(actions,startIp);
  int numActions=ip - startIp - 1;
  if (numActions <= 0)   return false;
switch (chooseCriteria) {
case ITERATE:
    chooseCount++;
  break;
case RANDOM:
chooseCount=MathUtils.random(0,numActions - 1);
break;
case CYCLE:
chooseCount=(chooseCount + 1) % numActions;
break;
}
v.setIP(ip);
if (chooseCount < numActions) {
return actions.get(ip0 + chooseCount).run(v);
}
return false;
}
Program: 30301
Project: 30301
Buggy source:
@Override public boolean run(ActionCallback cb){
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  return false;
}
Program: 30302
Project: 30302
Buggy source:
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getInventory().getItem(this.actor);
  if (actor == null) {
    EngineLogger.error(MessageFormat.format("String_Node_Str",this.actor));
    return false;
  }
  World.getInstance().getInventory().removeItem(this.actor);
  World.getInstance().getCurrentScene().addActor(actor);
  if (pos != null)   actor.setPosition(pos.x * scale,pos.y * scale);
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getInventory().getItem(this.actor);
  if (actor == null) {
    EngineLogger.error(MessageFormat.format("String_Node_Str",this.actor));
    return false;
  }
  World.getInstance().getInventory().removeItem(this.actor);
  World.getInstance().getCurrentScene().addActor(actor);
  if (pos != null)   actor.setPosition(pos.x * scale,pos.y * scale);
  return false;
}
Program: 30303
Project: 30303
Buggy source:
@Override public boolean run(ActionCallback cb){
  final VerbRunner v=(VerbRunner)cb;
  final List<Action> actions=v.getActions();
  final int ip=v.getIP();
  final int parentIp=getParentControlAction(caID,actions,ip);
  final AbstractControlAction parent=(AbstractControlAction)actions.get(parentIp);
  if (parent instanceof RepeatAction) {
    v.setIP(parentIp - 1);
  }
 else   if (parent instanceof AbstractIfAction) {
    int newIp=skipControlIdBlock(actions,parentIp);
    newIp=skipControlIdBlock(actions,newIp);
    v.setIP(newIp);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean run(VerbRunner cb){
  final VerbRunner v=(VerbRunner)cb;
  final List<Action> actions=v.getActions();
  final int ip=v.getIP();
  final int parentIp=getParentControlAction(caID,actions,ip);
  final AbstractControlAction parent=(AbstractControlAction)actions.get(parentIp);
  if (parent instanceof RepeatAction) {
    v.setIP(parentIp - 1);
  }
 else   if (parent instanceof AbstractIfAction) {
    int newIp=skipControlIdBlock(actions,parentIp);
    newIp=skipControlIdBlock(actions,newIp);
    v.setIP(newIp);
  }
  return false;
}
Program: 30304
Project: 30304
Buggy source:
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getCurrentScene().getActor(actorId,false);
  if (speed == 0 || !(actor instanceof SpriteActor)) {
    actor.setPosition(pos.x * scale,pos.y * scale);
    return false;
  }
 else {
    float s;
    if (mode != null && mode == Mode.SPEED) {
      Vector2 p0=new Vector2(actor.getX(),actor.getY());
      s=p0.dst(pos.x * scale,pos.y * scale) / (scale * speed);
    }
 else {
      s=speed;
    }
    ((SpriteActor)actor).startPosAnimation(repeat,count,s,pos.x * scale,pos.y * scale,interpolation,wait ? cb : null);
  }
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getCurrentScene().getActor(actorId,false);
  if (speed == 0 || !(actor instanceof SpriteActor)) {
    if (target == null) {
      actor.setPosition(pos.x * scale,pos.y * scale);
    }
 else {
      BaseActor target=World.getInstance().getCurrentScene().getActor(this.target,false);
      actor.setPosition(target.getX(),target.getY());
    }
    return false;
  }
 else {
    float s;
    if (mode != null && mode == Mode.SPEED) {
      Vector2 p0=new Vector2(actor.getX(),actor.getY());
      s=p0.dst(pos.x * scale,pos.y * scale) / (scale * speed);
    }
 else {
      s=speed;
    }
    if (target == null) {
      ((SpriteActor)actor).startPosAnimation(repeat,count,s,pos.x * scale,pos.y * scale,interpolation,wait ? cb : null);
    }
 else {
      BaseActor target=World.getInstance().getCurrentScene().getActor(this.target,false);
      ((SpriteActor)actor).startPosAnimation(repeat,count,s,target.getX(),target.getY(),interpolation,wait ? cb : null);
    }
  }
  return wait;
}
Program: 30305
Project: 30305
Buggy source:
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getCurrentScene().getActor(actorId,false);
  if (speed == 0 || !(actor instanceof SpriteActor)) {
    actor.setPosition(pos.x * scale,pos.y * scale);
    return false;
  }
 else {
    float s;
    if (mode != null && mode == Mode.SPEED) {
      Vector2 p0=new Vector2(actor.getX(),actor.getY());
      s=p0.dst(pos.x * scale,pos.y * scale) / (scale * speed);
    }
 else {
      s=speed;
    }
    ((SpriteActor)actor).startPosAnimation(repeat,count,s,pos.x * scale,pos.y * scale,interpolation,wait ? cb : null);
  }
  return wait;
}

Fixed version (ground truth):
@Override public boolean run(ActionCallback cb){
  float scale=EngineAssetManager.getInstance().getScale();
  BaseActor actor=World.getInstance().getCurrentScene().getActor(actorId,false);
  if (speed == 0 || !(actor instanceof SpriteActor)) {
    if (target == null) {
      actor.setPosition(pos.x * scale,pos.y * scale);
    }
 else {
      BaseActor target=World.getInstance().getCurrentScene().getActor(this.target,false);
      actor.setPosition(target.getX(),target.getY());
    }
    return false;
  }
 else {
    float s;
    if (mode != null && mode == Mode.SPEED) {
      Vector2 p0=new Vector2(actor.getX(),actor.getY());
      s=p0.dst(pos.x * scale,pos.y * scale) / (scale * speed);
    }
 else {
      s=speed;
    }
    if (target == null) {
      ((SpriteActor)actor).startPosAnimation(repeat,count,s,pos.x * scale,pos.y * scale,interpolation,wait ? cb : null);
    }
 else {
      BaseActor target=World.getInstance().getCurrentScene().getActor(this.target,false);
      actor.setPosition(target.getX(),target.getY());
    }
  }
  return wait;
}
Program: 30306
Project: 30306
Buggy source:
@Override public boolean run(ActionCallback cb){
  VerbRunner v=(VerbRunner)cb;
  int startIp=v.getIP();
  int ip0=startIp + 1;
  final List<Action> actions=v.getActions();
  int ip=skipControlIdBlock(actions,startIp);
  int numActions=ip - startIp;
  if (numActions <= 0)   return false;
switch (chooseCriteria) {
case ITERATE:
    chooseCount++;
  break;
case RANDOM:
chooseCount=MathUtils.random(0,numActions - 1);
break;
case CYCLE:
chooseCount=(chooseCount + 1) % numActions;
break;
}
v.setIP(ip);
if (chooseCount < numActions) {
return actions.get(ip0 + chooseCount).run(v);
}
return false;
}

Fixed version (ground truth):
@Override public boolean run(ActionCallback cb){
  VerbRunner v=(VerbRunner)cb;
  int startIp=v.getIP();
  int ip0=startIp + 1;
  final List<Action> actions=v.getActions();
  int ip=skipControlIdBlock(actions,startIp);
  int numActions=ip - startIp - 1;
  if (numActions <= 0)   return false;
switch (chooseCriteria) {
case ITERATE:
    chooseCount++;
  break;
case RANDOM:
chooseCount=MathUtils.random(0,numActions - 1);
break;
case CYCLE:
chooseCount=(chooseCount + 1) % numActions;
break;
}
v.setIP(ip);
if (chooseCount < numActions) {
return actions.get(ip0 + chooseCount).run(v);
}
return false;
}