nus-yam/ex-repair huggingface dataset:
Program: 153769
Project: 153769
Buggy source:
public void calculate_path(int x,int y){
  Point target=new Point(x,y);
  target=WorldModel.tile_map.world2local(target);
  Point source=new Point(owner.origin);
  source=WorldModel.tile_map.world2local(source);
  path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
  step=null;
}

Fixed version (ground truth):
public void calculate_path(int x,int y){
  Point target=new Point(x,y);
  target=WorldModel.tile_map.world2local(target);
  Point source=new Point(owner.origin);
  source=WorldModel.tile_map.world2local(source);
  path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
  step=null;
  if (path != null && path.getLength() >= 1) {
    path.steps.remove(0);
  }
}
Program: 153770
Project: 153770
Buggy source:
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 1) {
    if (step == null || step.equals(owner.origin)) {
      step=path.popStep();
    }
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    move_ent(owner.origin.getX() - 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    move_ent(owner.origin.getX() + 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() - 1);
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() + 1);
    owner.orientation=Orientation.ORIENT_S;
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
    step=null;
    path=null;
    ((NPCRenderer)owner.get_render()).set_frame(0);
  }
}

Fixed version (ground truth):
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 0) {
    if (step == null || step.equals(owner.origin)) {
      step=path.getStep(0);
    }
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    move_ent(owner.origin.getX() - 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    move_ent(owner.origin.getX() + 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() - 1);
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() + 1);
    owner.orientation=Orientation.ORIENT_S;
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
    step=null;
    path=null;
    ((NPCRenderer)owner.get_render()).set_frame(0);
  }
}
Program: 153771
Project: 153771
Buggy source:
public void change_tile(int x,int y){
  owner.dx=0.0f;
  owner.dy=0.0f;
  owner.move_to(new Point(x,y));
  step=null;
  System.out.println("String_Node_Str");
  if (owner.isPlayerEnt() && path != null) {
    System.out.println("String_Node_Str" + path_synch_counter);
    if (path_synch_counter == 0) {
      Point __dest;
      Step __step;
      if (path.getLength() > 0) {
        if (path.getLength() > SYNCH_CHUNK_SIZE) {
          __step=path.getStep(SYNCH_CHUNK_SIZE);
        }
 else {
          __step=path.getStep(path.getLength() - 1);
        }
      }
 else {
        __step=step;
      }
      __dest=new Point(__step.getX(),__step.getY());
      __dest=WorldModel.tile_map.local2world(__dest);
      System.out.println("String_Node_Str" + __step + "String_Node_Str"+ __dest+ "String_Node_Str"+ path.getLength()+ "String_Node_Str");
      System.out.println(path);
      EEntitySetPath dest_event=new EEntitySetPath(owner,__dest);
      dest_event.post();
    }
    path_synch_counter++;
    if (path_synch_counter >= SYNCH_CHUNK_SIZE) {
      path_synch_counter=0;
    }
  }
}

Fixed version (ground truth):
public void change_tile(int x,int y){
  owner.dx=0.0f;
  owner.dy=0.0f;
  owner.move_to(new Point(x,y));
  step=null;
  System.out.println("String_Node_Str");
  if (owner.isPlayerEnt() && path != null) {
    System.out.println("String_Node_Str" + path_synch_counter);
    System.out.println(path);
    if (path_synch_counter == 0) {
      Step __step=null;
      if (path.getLength() > 0) {
        if (path.getLength() > SYNCH_CHUNK_SIZE) {
          __step=path.getStep(SYNCH_CHUNK_SIZE);
        }
 else {
          __step=path.getStep(path.getLength() - 1);
        }
        notify_path(__step);
      }
    }
    path_synch_counter++;
    if (path_synch_counter >= SYNCH_CHUNK_SIZE) {
      path_synch_counter=0;
    }
  }
  if (path != null && path.getLength() > 0) {
    path.steps.remove(0);
  }
}
Program: 153772
Project: 153772
Buggy source:
public void sock_send(String msg){
  System.err.println("String_Node_Str" + msg + "String_Node_Str");
  out.println(msg);
}

Fixed version (ground truth):
public void sock_send(String msg){
  System.err.println(host + "String_Node_Str" + msg+ "String_Node_Str");
  out.println(msg);
}
Program: 153773
Project: 153773
Buggy source:
public Point world2local(Point world){
  origin.setLocation(WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE,WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE);
  world.setLocation(world.getX() - origin.getX(),world.getY() - origin.getY());
  return world;
}

Fixed version (ground truth):
public synchronized Point world2local(Point world){
  origin.setLocation(WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE,WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE);
  world.setLocation(world.getX() - origin.getX(),world.getY() - origin.getY());
  return world;
}
Program: 153774
Project: 153774
Buggy source:
public Point local2world(Point world){
  origin.setLocation(WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE,WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE);
  world.setLocation(world.getX() + origin.getX(),world.getY() + origin.getY());
  return world;
}

Fixed version (ground truth):
public synchronized Point local2world(Point world){
  origin.setLocation(WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE,WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE);
  world.setLocation(world.getX() + origin.getX(),world.getY() + origin.getY());
  return world;
}
Program: 153775
Project: 153775
Buggy source:
public Step popStep(){
  Step step=getStep(1);
  Step __step=new Step(step.getX(),step.getY());
  steps.remove(step);
  return __step;
}

Fixed version (ground truth):
public Step popStep(){
  Step step=getStep(0);
  Step __step=new Step(step.getX(),step.getY());
  steps.remove(step);
  return __step;
}
Program: 153776
Project: 153776
Buggy source:
public void calculate_path(int x,int y){
  Point target=new Point(x,y);
  target=WorldModel.tile_map.world2local(target);
  Point source=new Point(owner.origin);
  source=WorldModel.tile_map.world2local(source);
  path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
}

Fixed version (ground truth):
public void calculate_path(int x,int y){
  Point target=new Point(x,y);
  target=WorldModel.tile_map.world2local(target);
  Point source=new Point(owner.origin);
  source=WorldModel.tile_map.world2local(source);
  path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
  step=null;
}
Program: 153777
Project: 153777
Buggy source:
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 1) {
    if (step == null) {
      step=path.popStep();
    }
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    move_ent(owner.origin.getX() - 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    move_ent(owner.origin.getX() + 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() - 1);
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() + 1);
    owner.orientation=Orientation.ORIENT_S;
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
  }
}

Fixed version (ground truth):
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 1) {
    if (step == null || step.equals(owner.origin)) {
      step=path.popStep();
    }
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    move_ent(owner.origin.getX() - 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    move_ent(owner.origin.getX() + 1,owner.origin.getY());
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() - 1);
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    move_ent(owner.origin.getX(),owner.origin.getY() + 1);
    owner.orientation=Orientation.ORIENT_S;
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
    step=null;
    path=null;
  }
}
Program: 153778
Project: 153778
Buggy source:
@Override protected void parse_network_data(String[] data){
  if (data[0].equals("String_Node_Str") && data.length == 3) {
    System.out.println("String_Node_Str");
    EPlayerLogon event=new EPlayerLogon(new Point(Integer.parseInt(data[1]),Integer.parseInt(data[2])));
    event.post();
  }
  if (data[0].equals("String_Node_Str")) {
    Entity player_ent=new EntityNPC();
    EntityManager.add(player_ent);
    player_ent.spawn(Integer.parseInt(data[2]),new Point(Integer.parseInt(data[4]),Integer.parseInt(data[5])));
  }
  if (data[0].equals("String_Node_Str")) {
    Entity ent=EntityManager.get_entity(Integer.parseInt(data[1]));
    EntityManager.remove_entity(ent);
  }
  if (data[0].equals("String_Node_Str")) {
    Entity ent=EntityManager.get_entity(Integer.parseInt(data[1]));
    if (ent != null) {
      ent.move_to(new Point(Integer.parseInt(data[3]),Integer.parseInt(data[4])));
    }
 else {
      System.err.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override protected void parse_network_data(String[] data){
  if (data[0].equals("String_Node_Str") && data.length == 3) {
    System.out.println("String_Node_Str");
    EPlayerLogon event=new EPlayerLogon(new Point(Integer.parseInt(data[1]),Integer.parseInt(data[2])));
    event.post();
  }
  if (data[0].equals("String_Node_Str")) {
    Entity mplayer_ent=new EntityNPC();
    mplayer_ent.set_controller(new NpcController());
    EntityManager.add(mplayer_ent);
    mplayer_ent.spawn(Integer.parseInt(data[2]),new Point(Integer.parseInt(data[4]),Integer.parseInt(data[5])));
  }
  if (data[0].equals("String_Node_Str")) {
    Entity ent=EntityManager.get_entity(Integer.parseInt(data[1]));
    EntityManager.remove_entity(ent);
  }
  if (data[0].equals("String_Node_Str")) {
    Entity ent=EntityManager.get_entity(Integer.parseInt(data[1]));
    if (ent != null) {
      if (ent.controller != null) {
        ((NpcController)ent.controller).set_destination(new Point(Integer.parseInt(data[3]),Integer.parseInt(data[4])));
      }
 else {
        ent.move_to(new Point(Integer.parseInt(data[3]),Integer.parseInt(data[4])));
      }
    }
 else {
      System.err.println("String_Node_Str");
    }
  }
}
Program: 153780
Project: 153780
Buggy source:
public static void render(){
  long total=Runtime.getRuntime().totalMemory();
  long free=Runtime.getRuntime().freeMemory();
  OverlaySystem.ttf.drawString(10,5,"String_Node_Str" + String.format("String_Node_Str",free / (1024.0f * 1024)) + "String_Node_Str"+ Float.toString(total / (1024.0f * 1024))+ "String_Node_Str",Color.white);
  OverlaySystem.ttf.drawString(10,50,"String_Node_Str" + Integer.toString(Timer.get_fps()),Color.white);
  OverlaySystem.ttf.drawString(10,70,"String_Node_Str" + Integer.toString((int)WorldViewCamera.camera_x) + "String_Node_Str"+ Integer.toString((int)WorldViewCamera.camera_y)+ "String_Node_Str"+ WorldViewCamera.target.toString(),Color.white);
}

Fixed version (ground truth):
public static void render(){
  long total=Runtime.getRuntime().totalMemory();
  long free=Runtime.getRuntime().freeMemory();
  OverlaySystem.ttf.drawString(10,5,"String_Node_Str" + String.format("String_Node_Str",free / (1024.0f * 1024)) + "String_Node_Str"+ Float.toString(total / (1024.0f * 1024))+ "String_Node_Str",Color.white);
  if (Player.get_ent() != null) {
    NpcController npc_controller=(NpcController)Player.get_ent().controller;
    OverlaySystem.ttf.drawString(10,25,"String_Node_Str" + npc_controller.path + "String_Node_Str"+ "String_Node_Str"+ npc_controller.step,Color.white);
  }
  OverlaySystem.ttf.drawString(10,50,"String_Node_Str" + Integer.toString(Timer.get_fps()),Color.white);
  OverlaySystem.ttf.drawString(10,70,"String_Node_Str" + Integer.toString((int)WorldViewCamera.camera_x) + "String_Node_Str"+ Integer.toString((int)WorldViewCamera.camera_y)+ "String_Node_Str"+ WorldViewCamera.target.toString(),Color.white);
}
Program: 153781
Project: 153781
Buggy source:
public EntityPlayer(){
  BaseItem branch=BaseItem.produce("String_Node_Str",1);
  this.container.add_item(branch);
}

Fixed version (ground truth):
public EntityPlayer(){
  BaseItem branch=BaseItem.produce("String_Node_Str",1);
  this.container.add_item(branch);
  System.out.println(branch.get_container());
}
Program: 153782
Project: 153782
Buggy source:
public void drop(){
  container.remove_item(this);
}

Fixed version (ground truth):
public void drop(){
  if (container == null) {
    System.err.println("String_Node_Str");
    return;
  }
  container.remove_item(this);
}
Program: 153783
Project: 153783
Buggy source:
public BaseItem getItem(){
  BaseItem item=BaseItem.produce(type,count);
  return item;
}

Fixed version (ground truth):
public BaseItem getItem(){
  BaseItem item=BaseItem.produce(type,count);
  item.set_container(container);
  return item;
}
Program: 153784
Project: 153784
Buggy source:
public void context_popup(EMouseClick event){
class ActionDrop extends BaseItemAction {
    BaseItem item;
    public ActionDrop(    BaseItem item){
      this.item=item;
      this.name="String_Node_Str";
    }
    @Override public void execute(){
      System.out.println("String_Node_Str");
      item.drop();
    }
  }
  System.out.println("String_Node_Str");
  NE_GUI_Popup __popup=new NE_GUI_Popup();
  add(__popup);
  __popup.x=event.origin.getX();
  __popup.y=event.get_window_y();
  ArrayList action_list=item.get_action_list();
  Iterator<IAction> itr=action_list.iterator();
  while (itr.hasNext()) {
    IAction element=itr.next();
    __popup.add_item(element);
  }
  __popup.add_item(new ActionDrop(item));
}

Fixed version (ground truth):
public void context_popup(EMouseClick event){
class ActionDrop extends BaseItemAction {
    BaseItem item;
    public ActionDrop(    BaseItem item){
      this.item=item;
      this.name="String_Node_Str";
    }
    @Override public void execute(){
      System.out.println("String_Node_Str");
      if (item != null) {
        item.drop();
      }
    }
  }
  System.out.println("String_Node_Str");
  NE_GUI_Popup __popup=new NE_GUI_Popup();
  NE_GUI_System ui=Game.get_game_mode().get_ui().get_nge_ui();
  ui.root.add(__popup);
  __popup.x=event.origin.getX();
  __popup.y=event.get_window_y();
  ArrayList action_list=item.get_action_list();
  Iterator<IAction> itr=action_list.iterator();
  while (itr.hasNext()) {
    IAction element=itr.next();
    __popup.add_item(element);
  }
  __popup.add_item(new ActionDrop(item));
}
Program: 153785
Project: 153785
Buggy source:
public void update(ItemContainer container){
  if (container != this.container) {
    return;
  }
  inv_layer.clear();
  BaseItem[] items=(BaseItem[])container.items.toArray(new BaseItem[0]);
  for (int i=0; i < items.length; i++) {
    BaseItem item=(BaseItem)items[i];
    NE_GUI_Inventory_Item item_control=new NE_GUI_Inventory_Item(item);
    inv_layer.add(item_control);
    item_control.sprite_name="String_Node_Str" + item.get_type() + "String_Node_Str";
    item_control.x=get_item_x(i) * 32;
    item_control.y=get_item_y(i) * 32;
    item_control.w=32;
    item_control.h=32;
  }
}

Fixed version (ground truth):
public void update(ItemContainer container){
  if (container != this.container) {
    return;
  }
  inv_layer.clear();
  BaseItem[] items=(BaseItem[])container.items.toArray(new BaseItem[0]);
  for (int i=0; i < items.length; i++) {
    BaseItem item=(BaseItem)items[i];
    if (item.get_container() == null) {
      item.set_container(container);
    }
    NE_GUI_Inventory_Item item_control=new NE_GUI_Inventory_Item(item);
    inv_layer.add(item_control);
    item_control.sprite_name="String_Node_Str" + item.get_type() + "String_Node_Str";
    item_control.x=get_item_x(i) * 32;
    item_control.y=get_item_y(i) * 32;
    item_control.w=32;
    item_control.h=32;
    item_control.dragable=false;
  }
}
Program: 153786
Project: 153786
Buggy source:
@Override public void execute(){
  System.out.println("String_Node_Str");
  item.drop();
}

Fixed version (ground truth):
@Override public void execute(){
  System.out.println("String_Node_Str");
  if (item != null) {
    item.drop();
  }
}
Program: 153787
Project: 153787
Buggy source:
public static void notify_event(Event event){
  if (event == null) {
    return;
  }
  NE_GUI_System ui=Game.get_game_mode().get_ui().get_nge_ui();
  if (ui != null) {
    ui.e_on_event(event);
  }
  if (event.is_dispatched()) {
    return;
  }
  register_event(event);
synchronized (listeners_sync) {
    for (Iterator iter=listeners_sync.iterator(); iter.hasNext(); ) {
      IEventListener listener=(IEventListener)iter.next();
      listener.e_on_event(event);
    }
  }
}

Fixed version (ground truth):
public static void notify_event(Event event){
  if (event == null) {
    return;
  }
  NE_GUI_System ui=Game.get_game_mode().get_ui().get_nge_ui();
  if (ui != null) {
    ui.e_on_event(event);
  }
  if (event.is_dispatched()) {
    return;
  }
  register_event(event);
  IEventListener[] __listeners=(IEventListener[])listeners_sync.toArray(new IEventListener[0]);
  for (int i=0; i < __listeners.length; i++) {
    __listeners[i].e_on_event(event);
  }
}
Program: 153788
Project: 153788
Buggy source:
@Override public void think(){
  if (destination != null) {
    follow_path();
  }
  owner.sleep(50);
}

Fixed version (ground truth):
@Override public void think(){
  if (destination != null) {
    follow_path();
  }
}
Program: 153789
Project: 153789
Buggy source:
public void add_item(BaseItem item){
  Object[] elem=items.toArray();
  for (int i=0; i < elem.length; i++) {
    BaseItem tgt=(BaseItem)elem[i];
    if (tgt.get_type().equals(item.get_type())) {
      tgt.put_from(item);
    }
    if (item.is_empty()) {
      on_update();
      return;
    }
  }
  if (!is_full()) {
    items.add(item.getItem());
    on_update();
  }
}

Fixed version (ground truth):
public void add_item(BaseItem item){
  Object[] elem=items.toArray();
  for (int i=0; i < elem.length; i++) {
    BaseItem tgt=(BaseItem)elem[i];
    if (tgt.get_type().equals(item.get_type())) {
      tgt.put_from(item);
    }
    if (item.is_empty()) {
      on_update();
      return;
    }
  }
  if (!is_full()) {
    items.add(item.getItem());
    item.set_container(this);
    on_update();
  }
}
Program: 153790
Project: 153790
Buggy source:
public void remove_item(BaseItem item){
  int count=item.get_count();
}

Fixed version (ground truth):
public void remove_item(BaseItem item){
  items.remove(item);
  on_update();
}
Program: 153791
Project: 153791
Buggy source:
public void notify_event(Event e){
  if (!visible) {
    return;
  }
  Object[] elem=children.toArray();
  for (int i=0; i < elem.length; i++) {
    NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
    __elem.notify_event(e);
  }
  if (e instanceof EMouseClick) {
    EMouseClick event=(EMouseClick)e;
    if (event.is_dispatched()) {
      e_on_mouse_out_click(event);
      return;
    }
    int mx=event.origin.getX();
    int my=WindowRender.get_window_h() - event.origin.getY();
    if (parent != null) {
      mx=mx - parent.x;
      my=my - parent.y;
    }
    if (mx > x && mx < x + w && my > y && my < y + h) {
      if (!solid) {
        return;
      }
      System.out.println(this.toString() + "String_Node_Str");
      System.out.println(event.origin);
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease) {
    drag_start=false;
  }
  if (e instanceof EMouseDrag) {
    EMouseDrag event=(EMouseDrag)e;
    if (drag_start && dragable) {
      drag((int)event.dx,(int)event.dy);
    }
  }
  if (e instanceof EKeyPress) {
    EKeyPress event=(EKeyPress)e;
    e_on_key_press(event);
  }
}

Fixed version (ground truth):
public void notify_event(Event e){
  if (!visible) {
    return;
  }
  Object[] elem=children.toArray();
  for (int i=0; i < elem.length; i++) {
    NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
    __elem.notify_event(e);
  }
  if (e instanceof EMouseClick) {
    EMouseClick event=(EMouseClick)e;
    if (event.is_dispatched()) {
      e_on_mouse_out_click(event);
      return;
    }
    int mx=event.origin.getX();
    int my=WindowRender.get_window_h() - event.origin.getY();
    if (mx > get_x() && mx < get_x() + w && my > get_y() && my < get_y() + h) {
      if (!solid) {
        return;
      }
      System.out.println(this.toString() + "String_Node_Str");
      System.out.println(event.origin);
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease) {
    drag_start=false;
  }
  if (e instanceof EMouseDrag) {
    EMouseDrag event=(EMouseDrag)e;
    if (drag_start && dragable) {
      drag((int)event.dx,(int)event.dy);
    }
  }
  if (e instanceof EKeyPress) {
    EKeyPress event=(EKeyPress)e;
    e_on_key_press(event);
  }
}
Program: 153792
Project: 153792
Buggy source:
public void render(){
  if (children.isEmpty()) {
    return;
  }
  Object[] elem=children.toArray();
  for (int i=0; i < elem.length; i++) {
    NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
    __elem.render();
  }
}

Fixed version (ground truth):
public void render(){
  render_children();
}
Program: 153793
Project: 153793
Buggy source:
public void e_on_event_rollback(Event event){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
public void e_on_event_rollback(Event event){
}
Program: 153794
Project: 153794
Buggy source:
public void update(ItemContainer container){
  if (container != this.container) {
    return;
  }
  inv_layer.children.clear();
  BaseItem[] items=(BaseItem[])container.items.toArray(new BaseItem[0]);
  for (int i=0; i < items.length; i++) {
    BaseItem item=(BaseItem)items[i];
    NE_GUI_Inventory_Item item_control=new NE_GUI_Inventory_Item(item);
    inv_layer.add(item_control);
    item_control.sprite_name="String_Node_Str" + item.get_type() + "String_Node_Str";
    item_control.x=get_item_x(i) * 32;
    item_control.y=get_item_y(i) * 32;
    item_control.w=32;
    item_control.h=32;
  }
}

Fixed version (ground truth):
public void update(ItemContainer container){
  if (container != this.container) {
    return;
  }
  inv_layer.clear();
  BaseItem[] items=(BaseItem[])container.items.toArray(new BaseItem[0]);
  for (int i=0; i < items.length; i++) {
    BaseItem item=(BaseItem)items[i];
    NE_GUI_Inventory_Item item_control=new NE_GUI_Inventory_Item(item);
    inv_layer.add(item_control);
    item_control.sprite_name="String_Node_Str" + item.get_type() + "String_Node_Str";
    item_control.x=get_item_x(i) * 32;
    item_control.y=get_item_y(i) * 32;
    item_control.w=32;
    item_control.h=32;
  }
}
Program: 153795
Project: 153795
Buggy source:
public NE_GUI_Inventory(){
  super(true);
  this.set_tw(7);
  this.set_th(5);
  EventManager.subscribe(this);
  inv_layer=new NE_GUI_Element();
  inv_layer.x=32;
  inv_layer.y=32;
  inv_layer.solid=false;
  add(inv_layer);
}

Fixed version (ground truth):
public NE_GUI_Inventory(){
  super(true);
  this.set_tw(7);
  this.set_th(5);
  EventManager.subscribe(this);
  inv_layer=new NE_GUI_Element(){
    @Override public void e_on_mouse_click(    EMouseClick e){
      System.out.println("String_Node_Str");
    }
  }
;
  inv_layer.x=32;
  inv_layer.y=32;
  inv_layer.w=(this.t_window_w - 2) * 32;
  inv_layer.h=(this.t_window_h - 2) * 32;
  inv_layer.dragable=false;
  add(inv_layer);
}
Program: 153796
Project: 153796
Buggy source:
@Override public void e_on_mouse_click(EMouseClick e){
  action.execute();
}

Fixed version (ground truth):
@Override public void e_on_mouse_click(EMouseClick e){
  action.execute();
  e.dispatch();
}
Program: 153797
Project: 153797
Buggy source:
public void context_popup(EMouseClick event){
  Point tile_origin=WorldView.getTileCoord(event.origin);
  WorldTile tile=WorldModel.get_tile(tile_origin.getX(),tile_origin.getY());
  Entity ent=tile.get_obstacle();
  if (ent == null) {
    System.out.println("String_Node_Str");
    return;
  }
  NE_GUI_Popup __popup=new NE_GUI_Popup();
  ui.root.add(__popup);
  __popup.x=event.origin.getX();
  __popup.y=event.get_window_y();
  ArrayList action_list=ent.get_action_list();
  Iterator<IAction> itr=action_list.iterator();
  System.out.println("String_Node_Str" + Integer.toString(action_list.size()) + "String_Node_Str");
  while (itr.hasNext()) {
    IAction element=itr.next();
    __popup.add_item(element);
  }
}

Fixed version (ground truth):
public void context_popup(EMouseClick event){
class DropItem extends BaseItemAction {
    @Override public void execute(){
      System.out.println("String_Node_Str");
      System.out.print(get_owner());
    }
  }
  Point tile_origin=WorldView.getTileCoord(event.origin);
  WorldTile tile=WorldModel.get_tile(tile_origin.getX(),tile_origin.getY());
  Entity ent=tile.get_obstacle();
  if (ent == null) {
    System.out.println("String_Node_Str");
    return;
  }
  NE_GUI_Popup __popup=new NE_GUI_Popup();
  ui.root.add(__popup);
  __popup.x=event.origin.getX();
  __popup.y=event.get_window_y();
  ArrayList action_list=ent.get_action_list();
  Iterator<IAction> itr=action_list.iterator();
  System.out.println("String_Node_Str" + Integer.toString(action_list.size()) + "String_Node_Str");
  while (itr.hasNext()) {
    IAction element=itr.next();
    __popup.add_item(element);
  }
}
Program: 153798
Project: 153798
Buggy source:
public static void main(String[] args){
  game=new Game();
  game.set_state(Game.GameModes.InGame);
  game.run();
}

Fixed version (ground truth):
public static void main(String[] args){
  game=new Game();
  game.set_state(Game.GameModes.MainMenu);
  game.run();
}
Program: 153799
Project: 153799
Buggy source:
public Io(){
  try {
    tcp_sock=new ServerSocket();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public Io(){
}
Program: 153800
Project: 153800
Buggy source:
public void notify_event(Event e){
  if (!visible) {
    return;
  }
  Object[] elem=children.toArray();
  for (int i=0; i < elem.length; i++) {
    NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
    __elem.notify_event(e);
  }
  if (e instanceof EMouseClick) {
    EMouseClick event=(EMouseClick)e;
    if (event.is_dispatched()) {
      e_on_mouse_out_click(event);
      return;
    }
    int mx=event.origin.getX();
    int my=WindowRender.get_window_h() - event.origin.getY();
    if (mx > get_x() && mx < get_x() + w && my > get_y() && my < get_y() + h) {
      if (!solid) {
        return;
      }
      System.out.println(this.toString() + "String_Node_Str");
      System.out.println(event.origin);
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease) {
    drag_start=false;
  }
  if (e instanceof EMouseDrag) {
    EMouseDrag event=(EMouseDrag)e;
    if (drag_start && dragable) {
      drag((int)event.dx,(int)event.dy);
    }
  }
  if (e instanceof EKeyPress) {
    EKeyPress event=(EKeyPress)e;
    e_on_key_press(event);
  }
}

Fixed version (ground truth):
public void notify_event(Event e){
  if (!visible) {
    return;
  }
  Object[] elem=children.toArray();
  for (int i=elem.length - 1; i >= 0; i--) {
    NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
    __elem.notify_event(e);
  }
  if (e instanceof EMouseClick) {
    EMouseClick event=(EMouseClick)e;
    if (event.is_dispatched()) {
      e_on_mouse_out_click(event);
      return;
    }
    int mx=event.origin.getX();
    int my=WindowRender.get_window_h() - event.origin.getY();
    if (mx > get_x() && mx < get_x() + w && my > get_y() && my < get_y() + h) {
      if (!solid) {
        return;
      }
      System.out.println(this.toString() + "String_Node_Str");
      System.out.println(event.origin);
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease) {
    drag_start=false;
  }
  if (e instanceof EMouseDrag) {
    EMouseDrag event=(EMouseDrag)e;
    if (drag_start && dragable) {
      drag((int)event.dx,(int)event.dy);
    }
  }
  if (e instanceof EKeyPress) {
    EKeyPress event=(EKeyPress)e;
    e_on_key_press(event);
  }
}
Program: 153801
Project: 153801
Buggy source:
@Override public void render(){
  if (!visible) {
    return;
  }
  Render.bind_texture("String_Node_Str");
  int tile_id=0;
  for (int i=0; i < t_window_w; i++)   for (int j=0; j < t_window_h; j++) {
    if (j == 0) {
      if (i == 0)       tile_id=0;
 else       if (i == t_window_w - 1)       tile_id=2;
 else       tile_id=1;
    }
 else     if (j == t_window_h - 1) {
      if (i == 0)       tile_id=8;
 else       if (i == t_window_w - 1)       tile_id=10;
 else       tile_id=9;
    }
 else {
      if (i == 0)       tile_id=4;
 else       if (i == t_window_w - 1)       tile_id=6;
 else       tile_id=5;
    }
    render_window_tile(i,j,tile_id);
  }
  super.render();
}

Fixed version (ground truth):
@Override public void render(){
  if (!visible) {
    return;
  }
  Render.bind_texture("String_Node_Str");
  glColor3f(1.0f,1.0f,1.0f);
  int tile_id=0;
  for (int i=0; i < t_window_w; i++)   for (int j=0; j < t_window_h; j++) {
    if (j == 0) {
      if (i == 0)       tile_id=0;
 else       if (i == t_window_w - 1)       tile_id=2;
 else       tile_id=1;
    }
 else     if (j == t_window_h - 1) {
      if (i == 0)       tile_id=8;
 else       if (i == t_window_w - 1)       tile_id=10;
 else       tile_id=9;
    }
 else {
      if (i == 0)       tile_id=4;
 else       if (i == t_window_w - 1)       tile_id=6;
 else       tile_id=5;
    }
    render_window_tile(i,j,tile_id);
  }
  super.render();
}
Program: 153802
Project: 153802
Buggy source:
public static void render(){
  BaseItem[] items=(BaseItem[])Player.get_ent().container.items.toArray(new BaseItem[0]);
  OverlaySystem.ttf.drawString(10,100,"String_Node_Str",Color.white);
  for (int i=0; i < items.length; i++) {
    OverlaySystem.ttf.drawString(10,120 + i * 20,items[i].get_type() + "String_Node_Str" + Integer.toString(items[i].get_count()),Color.white);
  }
}

Fixed version (ground truth):
public static void render(){
  if (Player.get_ent() == null) {
    return;
  }
  BaseItem[] items=(BaseItem[])Player.get_ent().container.items.toArray(new BaseItem[0]);
  OverlaySystem.ttf.drawString(10,100,"String_Node_Str",Color.white);
  for (int i=0; i < items.length; i++) {
    OverlaySystem.ttf.drawString(10,120 + i * 20,items[i].get_type() + "String_Node_Str" + Integer.toString(items[i].get_count()),Color.white);
  }
}
Program: 153803
Project: 153803
Buggy source:
@Override public void e_on_mouse_click(EMouseClick e){
  Main.game.set_state(Game.GameModes.InGame);
}

Fixed version (ground truth):
@Override public void e_on_mouse_click(EMouseClick e){
  Io.connect();
  boolean login_result=Io.login(login_input.text,pass_input.text);
  if (login_result) {
    Main.game.set_state(Game.GameModes.InGame);
  }
 else {
    show_message("String_Node_Str");
  }
}
Program: 153804
Project: 153804
Buggy source:
public void build_ui(){
  NE_GUI_Frame frame=new NE_GUI_Frame(false);
  ui.root.add(frame);
  frame.set_tw(12);
  frame.set_th(6);
  NE_GUI_Input login_input=new NE_GUI_Input();
  frame.add(login_input);
  login_input.x=180;
  login_input.y=50;
  login_input.w=120;
  login_input.dragable=false;
  NE_GUI_Input pass_input=new NE_GUI_Input();
  frame.add(pass_input);
  pass_input.x=180;
  pass_input.y=80;
  pass_input.w=120;
  pass_input.dragable=false;
  NE_GUI_Label label1=new NE_GUI_Label();
  frame.add(label1);
  label1.text="String_Node_Str";
  label1.x=100;
  label1.y=50;
  NE_GUI_Label label2=new NE_GUI_Label();
  frame.add(label2);
  label2.text="String_Node_Str";
  label2.x=100;
  label2.y=80;
  NE_GUI_Button button=new NE_GUI_Button(){
    @Override public void e_on_mouse_click(    EMouseClick e){
      Main.game.set_state(Game.GameModes.InGame);
    }
  }
;
  frame.add(button);
  button.dragable=false;
  button.x=140;
  button.y=120;
  button.set_tw(3);
}

Fixed version (ground truth):
public void build_ui(){
  NE_GUI_Frame frame=new NE_GUI_Frame(false);
  ui.root.add(frame);
  frame.set_tw(12);
  frame.set_th(6);
  login_input=new NE_GUI_Input();
  frame.add(login_input);
  login_input.x=180;
  login_input.y=50;
  login_input.w=120;
  login_input.dragable=false;
  login_input.text="String_Node_Str";
  pass_input=new NE_GUI_Input();
  frame.add(pass_input);
  pass_input.x=180;
  pass_input.y=80;
  pass_input.w=120;
  pass_input.dragable=false;
  pass_input.text="String_Node_Str";
  NE_GUI_Label label1=new NE_GUI_Label();
  frame.add(label1);
  label1.text="String_Node_Str";
  label1.x=100;
  label1.y=50;
  NE_GUI_Label label2=new NE_GUI_Label();
  frame.add(label2);
  label2.text="String_Node_Str";
  label2.x=100;
  label2.y=80;
  NE_GUI_Button button=new NE_GUI_Button(){
    @Override public void e_on_mouse_click(    EMouseClick e){
      Io.connect();
      boolean login_result=Io.login(login_input.text,pass_input.text);
      if (login_result) {
        Main.game.set_state(Game.GameModes.InGame);
      }
 else {
        show_message("String_Node_Str");
      }
    }
  }
;
  frame.add(button);
  button.dragable=false;
  button.x=140;
  button.y=120;
  button.set_tw(3);
}
Program: 153805
Project: 153805
Buggy source:
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 0) {
    System.out.println("String_Node_Str" + Integer.toString(path.getLength()));
    Step step=path.popStep();
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    owner.move_to(new Point(owner.origin.getX() - 1,owner.origin.getY()));
  }
  if (owner.origin.getX() < __destination.getX()) {
    owner.move_to(new Point(owner.origin.getX() + 1,owner.origin.getY()));
  }
  if (owner.origin.getY() > __destination.getY()) {
    owner.move_to(new Point(owner.origin.getX(),owner.origin.getY() - 1));
  }
  if (owner.origin.getY() < __destination.getY()) {
    owner.move_to(new Point(owner.origin.getX(),owner.origin.getY() + 1));
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
  }
}

Fixed version (ground truth):
public void follow_path(){
  Point __destination=new Point(this.destination);
  if (path != null && path.getLength() > 0) {
    for (int i=0; i < path.getLength(); i++) {
      Step tmp_step=path.getStep(i);
      Point tmp=new Point(tmp_step.getX(),tmp_step.getY());
      tmp=WorldModel.tile_map.local2world(tmp);
      System.out.println("String_Node_Str" + Integer.toString(i) + tmp.toString());
    }
    Step step=path.popStep();
    Point location=new Point(step.getX(),step.getY());
    location=WorldModel.tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  if (owner.origin.getX() > __destination.getX()) {
    owner.move_to(new Point(owner.origin.getX() - 1,owner.origin.getY()));
  }
  if (owner.origin.getX() < __destination.getX()) {
    owner.move_to(new Point(owner.origin.getX() + 1,owner.origin.getY()));
  }
  if (owner.origin.getY() > __destination.getY()) {
    owner.move_to(new Point(owner.origin.getX(),owner.origin.getY() - 1));
  }
  if (owner.origin.getY() < __destination.getY()) {
    owner.move_to(new Point(owner.origin.getX(),owner.origin.getY() + 1));
  }
  if (owner.origin.equals(destination)) {
    this.destination=null;
  }
}
Program: 153806
Project: 153806
Buggy source:
public boolean blocked(Mover mover,int x,int y){
  WorldTile tile=get_tile(x,y);
  if (tile == null) {
    return true;
  }
  return tile.is_blocked();
}

Fixed version (ground truth):
public boolean blocked(Mover mover,int x,int y){
  temp.setLocation(x,y);
  temp=local2world(temp);
  WorldTile tile=get_tile(temp.getX(),temp.getY());
  if (tile == null) {
    return true;
  }
  return tile.is_blocked();
}
Program: 153807
Project: 153807
Buggy source:
public synchronized Step popStep(){
  Step step=getStep(1);
  Step __step=new Step(step.getX(),step.getY());
  steps.remove(step);
  return __step;
}

Fixed version (ground truth):
public Step popStep(){
  Step step=getStep(0);
  Step __step=new Step(step.getX(),step.getY());
  steps.remove(step);
  return __step;
}
Program: 153808
Project: 153808
Buggy source:
public DebugRenderer(){
  tileset=new Tileset();
  tileset.texture_name="String_Node_Str";
}

Fixed version (ground truth):
public DebugRenderer(){
  System.out.println("String_Node_Str");
  tileset=new Tileset();
  tileset.texture_name="String_Node_Str";
}
Program: 153809
Project: 153809
Buggy source:
@Override public void render(){
  if (ent == null) {
    return;
  }
  this.tileset.render_sprite(ent.origin.getX(),ent.origin.getY(),8);
  Point ent_screen=WorldView.world2local(ent.origin);
  OverlaySystem.ttf.drawString(ent_screen.getX(),ent_screen.getY(),ent.toString(),Color.white);
}

Fixed version (ground truth):
@Override public void render(){
  if (ent == null) {
    return;
  }
  this.tileset.render_sprite(ent.origin.getX(),ent.origin.getY(),8);
}
Program: 153810
Project: 153810
Buggy source:
public static void build_chunk(Point origin){
  System.out.println("String_Node_Str" + origin.toString());
  int x=origin.getX() * WorldChunk.CHUNK_SIZE;
  int y=origin.getY() * WorldChunk.CHUNK_SIZE;
  int size=WorldChunk.CHUNK_SIZE;
  for (int i=x; i < x + size; i++)   for (int j=y; j < y + size; j++) {
    int tile_id=0;
    int height=Terrain.get_height(i,j);
    if (height > 120) {
      tile_id=25;
    }
    WorldTile tile=new WorldTile(tile_id);
    tile.set_height(height);
    if (Terrain.is_tree(tile)) {
      tile.set_tile_id(50);
    }
    tile_data.put(new Point(i,j),tile);
  }
}

Fixed version (ground truth):
public static void build_chunk(Point origin){
  System.out.println("String_Node_Str" + origin.toString());
  int x=origin.getX() * WorldChunk.CHUNK_SIZE;
  int y=origin.getY() * WorldChunk.CHUNK_SIZE;
  int size=WorldChunk.CHUNK_SIZE;
  for (int i=x; i < x + size; i++)   for (int j=y; j < y + size; j++) {
    int tile_id=0;
    int height=Terrain.get_height(i,j);
    if (height > 120) {
      tile_id=25;
    }
    WorldTile tile=new WorldTile(tile_id);
    tile.set_height(height);
    if (Terrain.is_tree(tile)) {
      tile.set_tile_id(50);
      Entity tree_ent=new Entity();
      EntityManager.add(tree_ent);
      tree_ent.spawn(1,new Point(i,j));
    }
    tile_data.put(new Point(i,j),tile);
  }
}
Program: 153811
Project: 153811
Buggy source:
public static WorldChunk precache_chunk(int x,int y){
  WorldChunk chunk=new WorldChunk(x,y);
  build_chunk(chunk.origin);
  chunk_data.put(new Point(x,y),chunk);
  return chunk;
}

Fixed version (ground truth):
public static WorldChunk precache_chunk(int x,int y){
  WorldChunk chunk=new WorldChunk(x,y);
  chunk_data.put(new Point(x,y),chunk);
  build_chunk(chunk.origin);
  return chunk;
}
Program: 153812
Project: 153812
Buggy source:
public void render_background(){
  int x=WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE;
  int y=WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE;
  int size=WorldCluster.CLUSTER_SIZE * WorldChunk.CHUNK_SIZE;
  for (int i=x; i < x + size; i++)   for (int j=y; j < y + size; j++) {
    int chunk_x=(i) / WorldChunk.CHUNK_SIZE;
    int chunk_y=(j) / WorldChunk.CHUNK_SIZE;
    if (WorldModel.get_cached_chunk(chunk_x,chunk_y) != null) {
      WorldTile tile=WorldModel.get_tile(i,j);
      if (tile != null) {
        float g_color=((float)tile.get_height() / 255) * 2;
        GL11.glColor3f(1.0f,g_color,1.0f);
        bg_tileset.render_bg_tile(i,j,tile.get_tile_id());
      }
    }
  }
}

Fixed version (ground truth):
public void render_background(){
  int x=WorldCluster.origin.getX() * WorldChunk.CHUNK_SIZE;
  int y=WorldCluster.origin.getY() * WorldChunk.CHUNK_SIZE;
  int size=WorldCluster.CLUSTER_SIZE * WorldChunk.CHUNK_SIZE;
  for (int i=x; i < x + size; i++)   for (int j=y; j < y + size; j++) {
    int chunk_x=(int)Math.floor((float)i / WorldChunk.CHUNK_SIZE);
    int chunk_y=(int)Math.floor((float)j / WorldChunk.CHUNK_SIZE);
    if (WorldModel.get_cached_chunk(chunk_x,chunk_y) != null) {
      WorldTile tile=WorldModel.get_tile(i,j);
      if (tile != null) {
        float g_color=((float)tile.get_height() / 255) * 2;
        GL11.glColor3f(1.0f,g_color,1.0f);
        bg_tileset.render_bg_tile(i,j,tile.get_tile_id());
      }
    }
  }
}
Program: 153813
Project: 153813
Buggy source:
public void render_tile(int i,int j,int tile_id){
  Render.bind_texture(texture_name);
  glBegin(GL_QUADS);
  if (i % 16 == 0) {
    tile_id=8;
  }
  if (j % 16 == 0) {
    tile_id=8;
  }
  float tx=get_texture_x(tile_id);
  float ty=get_texture_y(tile_id);
  float ts=get_texture_size();
  glTexCoord2f(tx,ty);
  glVertex2f(i * TILE_SIZE,j * TILE_SIZE);
  glTexCoord2f(tx + ts,ty);
  glVertex2f((i + 1) * TILE_SIZE - 1,j * TILE_SIZE);
  glTexCoord2f(tx + ts,ty + ts);
  glVertex2f((i + 1) * TILE_SIZE - 1,((j + 1) * TILE_SIZE - 1));
  glTexCoord2f(tx,ty + ts);
  glVertex2f(i * TILE_SIZE,((j + 1) * TILE_SIZE - 1));
  glEnd();
}

Fixed version (ground truth):
public void render_tile(int i,int j,int tile_id){
  Render.bind_texture(texture_name);
  glBegin(GL_QUADS);
  if (i % WorldChunk.CHUNK_SIZE == 0) {
    tile_id=8;
  }
  if (j % WorldChunk.CHUNK_SIZE == 0) {
    tile_id=8;
  }
  float tx=get_texture_x(tile_id);
  float ty=get_texture_y(tile_id);
  float ts=get_texture_size();
  glTexCoord2f(tx,ty);
  glVertex2f(i * TILE_SIZE,j * TILE_SIZE);
  glTexCoord2f(tx + ts,ty);
  glVertex2f((i + 1) * TILE_SIZE - 1,j * TILE_SIZE);
  glTexCoord2f(tx + ts,ty + ts);
  glVertex2f((i + 1) * TILE_SIZE - 1,((j + 1) * TILE_SIZE - 1));
  glTexCoord2f(tx,ty + ts);
  glVertex2f(i * TILE_SIZE,((j + 1) * TILE_SIZE - 1));
  glEnd();
}
Program: 153814
Project: 153814
Buggy source:
public static void render(){
  if (!Input.key_state_alt) {
    return;
  }
  int x=Mouse.getX();
  int y=Mouse.getY();
  Point tile_coord=WorldView.getTileCoord(x,y);
  y=WindowRender.get_window_h() - y;
  OverlaySystem.ttf.drawString(x + 20,y - 10,"String_Node_Str" + Integer.toString(tile_coord.getX()) + "String_Node_Str"+ Integer.toString(tile_coord.getY())+ "String_Node_Str",Color.white);
}

Fixed version (ground truth):
public static void render(){
  if (!Input.key_state_alt) {
    return;
  }
  int x=Mouse.getX();
  int y=Mouse.getY();
  Point tile_coord=WorldView.getTileCoord(x,y);
  Point chunk_coord=WorldModel.get_chunk_coord(tile_coord);
  y=WindowRender.get_window_h() - y;
  OverlaySystem.ttf.drawString(x + 20,y - 10,"String_Node_Str" + Integer.toString(tile_coord.getX()) + "String_Node_Str"+ Integer.toString(tile_coord.getY())+ "String_Node_Str"+ Integer.toString(chunk_coord.getX())+ "String_Node_Str"+ Integer.toString(chunk_coord.getY())+ "String_Node_Str",Color.white);
}
Program: 153815
Project: 153815
Buggy source:
public void e_on_event(Event event){
  if (event instanceof EEntityMove) {
    EEntityMove move_event=(EEntityMove)event;
    move_entity(move_event.entity,move_event.getTo());
    if (move_event.entity.isPlayerEnt()) {
      WorldViewCamera.target.setLocation(move_event.entity.origin);
    }
  }
 else   if (event instanceof EEntitySpawn) {
    EEntitySpawn spawn_event=(EEntitySpawn)event;
    WorldChunk new_chunk=get_cached_chunk(get_chunk_coord(spawn_event.ent.origin));
    EEntityChangeChunk e_change_chunk=new EEntityChangeChunk(spawn_event.ent,null,new_chunk);
    e_change_chunk.post();
  }
 else   if (event instanceof EEntityChangeChunk) {
    EEntityChangeChunk e_change_chunk=(EEntityChangeChunk)event;
    System.out.println("String_Node_Str" + Entity.toString(e_change_chunk.ent));
    Entity ent=e_change_chunk.ent;
    ent.set_chunk(e_change_chunk.to);
    if (ent.isPlayerEnt()) {
      WorldCluster.locate(e_change_chunk.to.origin);
    }
  }
}

Fixed version (ground truth):
public void e_on_event(Event event){
  if (event instanceof EEntityMove) {
    EEntityMove move_event=(EEntityMove)event;
    move_entity(move_event.entity,move_event.getTo());
    if (move_event.entity.isPlayerEnt()) {
      WorldViewCamera.target.setLocation(move_event.entity.origin);
    }
  }
 else   if (event instanceof EEntitySpawn) {
    EEntitySpawn spawn_event=(EEntitySpawn)event;
    WorldChunk new_chunk=get_cached_chunk(get_chunk_coord(spawn_event.ent.origin));
    EEntityChangeChunk e_change_chunk=new EEntityChangeChunk(spawn_event.ent,null,new_chunk);
    e_change_chunk.post();
  }
 else   if (event instanceof EEntityChangeChunk) {
    EEntityChangeChunk e_change_chunk=(EEntityChangeChunk)event;
    System.err.println("String_Node_Str" + Entity.toString(e_change_chunk.ent));
    Entity ent=e_change_chunk.ent;
    ent.set_chunk(e_change_chunk.to);
    if (ent.isPlayerEnt()) {
      WorldCluster.locate(e_change_chunk.to.origin);
    }
  }
}
Program: 153816
Project: 153816
Buggy source:
public static Point get_chunk_coord(Point position){
  int cx=(int)Math.floor(position.getX() / WorldChunk.CHUNK_SIZE);
  int cy=(int)Math.floor(position.getY() / WorldChunk.CHUNK_SIZE);
  return new Point(cx,cy);
}

Fixed version (ground truth):
public static Point get_chunk_coord(Point position){
  int cx=(int)Math.floor((float)position.getX() / WorldChunk.CHUNK_SIZE);
  int cy=(int)Math.floor((float)position.getY() / WorldChunk.CHUNK_SIZE);
  return new Point(cx,cy);
}
Program: 153817
Project: 153817
Buggy source:
/** 
 * @param st
 */
public void addSkill(SkillsTemplate st){
  ClickablePanel panel=new ClickablePanel(st.getName());
  LeftPane.add(panel);
  System.out.println("String_Node_Str" + panel.getName());
}

Fixed version (ground truth):
/** 
 * @param st
 */
public void addSkill(SkillsTemplate st){
  ClickablePanel panel=new ClickablePanel(st);
  LeftPane.add(panel);
  System.out.println("String_Node_Str" + panel.getName());
}
Program: 153818
Project: 153818
Buggy source:
public ClickablePanel(){
  setDimensions();
}

Fixed version (ground truth):
public ClickablePanel(String string){
  this.setName(string);
}