nus-yam/ex-repair huggingface dataset:
Program: 153715
Project: 153715
Buggy source:
/** 
 * Creates new form StaticsMain 
 */
public StaticsMain(){
  Init();
  initComponents();
  for (  IStaticsPage p : StaticPages) {
    this.ui_comboBox.addItem(p);
  }
  this.ui_comboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      System.out.printf("String_Node_Str");
      IStaticsPage ip=(IStaticsPage)e.getItem();
      changeItem(ip);
    }
  }
);
  this.changeItem((IStaticsPage)ui_comboBox.getSelectedItem());
}

Fixed version (ground truth):
/** 
 * Creates new form StaticsMain 
 */
public StaticsMain(){
  Init();
  initComponents();
  for (  IStaticsPage p : StaticPages) {
    this.ui_comboBox.addItem(p);
  }
  this.ui_comboBox.addItemListener(new ItemListener(){
    public void itemStateChanged(    ItemEvent e){
      IStaticsPage ip=(IStaticsPage)e.getItem();
      changeItem(ip);
    }
  }
);
  this.changeItem((IStaticsPage)ui_comboBox.getSelectedItem());
}
Program: 153716
Project: 153716
Buggy source:
private void onStaticsShow(){
  if (m_mainWindow == null) {
    MainWindow wd=new MainWindow();
    wd.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    m_mainWindow=wd;
  }
  m_mainWindow.setVisible(true);
}

Fixed version (ground truth):
void onStaticsShow(){
  SmallWindow.onStaticsShow();
}
Program: 153717
Project: 153717
Buggy source:
private void initComponents(){
  try {
    if (SystemTray.isSupported()) {
      SystemTray st=SystemTray.getSystemTray();
      PopupMenu pm=new PopupMenu();
      MenuItem changeUserMenu=new MenuItem("String_Node_Str");
      changeUserMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          onStaticsShow();
        }
      }
);
      MenuItem exitMenu=new MenuItem("String_Node_Str");
      exitMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          System.exit(0);
        }
      }
);
      pm.add(changeUserMenu);
      pm.addSeparator();
      pm.add(exitMenu);
      TrayIcon ti=new TrayIcon(new ImageIcon(getClass().getResource("String_Node_Str")).getImage(),"String_Node_Str",pm);
      ti.setImageAutoSize(true);
      st.add(ti);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void initComponents(){
  try {
    if (SystemTray.isSupported()) {
      SystemTray st=SystemTray.getSystemTray();
      PopupMenu pm=new PopupMenu();
      MenuItem changeUserMenu=new MenuItem("String_Node_Str");
      changeUserMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          onStaticsShow();
        }
      }
);
      MenuItem exitMenu=new MenuItem("String_Node_Str");
      exitMenu.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent e){
          System.exit(0);
        }
      }
);
      pm.add(changeUserMenu);
      pm.addSeparator();
      pm.add(exitMenu);
      TrayIcon ti=new TrayIcon(new ImageIcon(getClass().getResource("String_Node_Str")).getImage(),"String_Node_Str",pm);
      ti.setImageAutoSize(true);
      st.add(ti);
      m_trayIcon=ti;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 153718
Project: 153718
Buggy source:
public TrayIconWindow(){
  initComponents();
}

Fixed version (ground truth):
private TrayIconWindow(){
  initComponents();
}
Program: 153721
Project: 153721
Buggy source:
public void onPoolRefresh(IPacketPoolEvent e){
  double us=e.getUploadSpeed() / 1024;
  double ds=e.getDownloadSpeed() / 1024;
  this.ui_downloadSpeed.setText(String.format("String_Node_Str",us));
  this.ui_uploadSpeed.setText(String.format("String_Node_Str",ds));
}

Fixed version (ground truth):
public void onPoolRefresh(IPacketPoolEvent e){
  double us=e.getUploadSpeed() / 1024;
  double ds=e.getDownloadSpeed() / 1024;
  this.ui_downloadSpeed.setText(String.format("String_Node_Str",ds));
  this.ui_uploadSpeed.setText(String.format("String_Node_Str",us));
}
Program: 153722
Project: 153722
Buggy source:
private void sendNetworkEvent(NetworkEvent event){
  System.out.println("String_Node_Str" + event.classname() + "String_Node_Str");
  if (!whitelisted(event.classname())) {
    System.out.println("String_Node_Str");
    return;
  }
  String[] tokens=event.serialize();
  StringBuilder sb=new StringBuilder();
  sb.append(event.classname().concat("String_Node_Str"));
  for (int i=1; i < tokens.length; i++) {
    sb.append(tokens[i].concat("String_Node_Str"));
  }
  sendMsg(sb.toString());
}

Fixed version (ground truth):
private void sendNetworkEvent(NetworkEvent event){
  System.out.println("String_Node_Str" + event.classname() + "String_Node_Str");
  if (!whitelisted(event.classname())) {
    System.out.println("String_Node_Str" + name + "String_Node_Str");
    return;
  }
  String[] tokens=event.serialize();
  StringBuilder sb=new StringBuilder();
  sb.append(event.classname().concat("String_Node_Str"));
  for (int i=1; i < tokens.length; i++) {
    sb.append(tokens[i].concat("String_Node_Str"));
  }
  sendMsg(sb.toString());
}
Program: 153723
Project: 153723
Buggy source:
@Override public void post(){
  WorldTile tile=entity.getLayer().get_tile(this.to.getX(),this.to.getY());
  if (tile != null && !tile.is_blocked()) {
    super.post();
  }
}

Fixed version (ground truth):
@Override public void post(){
  WorldTile tile=entity.getLayer().get_tile(this.to.getX(),this.to.getY());
  if (tile != null && !tile.is_blocked()) {
    super.post();
  }
 else {
    System.out.println("String_Node_Str" + this.to + "String_Node_Str");
  }
}
Program: 153724
Project: 153724
Buggy source:
private void notify_path(Step __step){
  Point __dest=__step.getPoint();
  __dest=ClientGameEnvironment.getWorldLayer(Player.get_zindex()).tile_map.local2world(__dest);
  EEntitySetPath dest_event=new EEntitySetPath(owner,__dest);
  dest_event.post();
}

Fixed version (ground truth):
private void notify_path(Step __step){
  System.out.println("String_Node_Str");
  Point __dest=__step.getPoint();
  __dest=ClientGameEnvironment.getWorldLayer(Player.get_zindex()).tile_map.local2world(__dest);
  EEntitySetPath dest_event=new EEntitySetPath(owner,__dest);
  dest_event.setManager(ClientGameEnvironment.getEnvironment().getEventManager());
  System.out.println("String_Node_Str");
  dest_event.post();
}
Program: 153725
Project: 153725
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;
  if (owner.isPlayerEnt() && path != null) {
    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);
  }
}

Fixed version (ground truth):
public void change_tile(int x,int y){
  Step __step=null;
  System.out.println("String_Node_Str" + path_synch_counter + "String_Node_Str"+ path.getLength());
  if (owner.isPlayerEnt() && path != null) {
    if (path_synch_counter == 0) {
      System.out.println("String_Node_Str");
      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;
    }
  }
  owner.dx=0.0f;
  owner.dy=0.0f;
  owner.move_to(new Point(x,y));
  step=null;
  if (path != null && path.getLength() > 0) {
    path.steps.remove(0);
  }
}
Program: 153726
Project: 153726
Buggy source:
public void update(){
  try {
    Io.update();
  }
 catch (  IOException ex) {
    Logger.getLogger(ModeInGame.class.getName()).log(Level.SEVERE,null,ex);
  }
  Input.update();
  ClientEventManager.update();
  EventManager.update();
  model.update();
  fx.update();
  view.render();
  fx.render();
  get_ui().update();
  get_ui().render();
  DebugOverlay.debugPathfinding();
  overlay.render();
  Main.neServer.update();
}

Fixed version (ground truth):
public void update(){
  try {
    Io.update();
  }
 catch (  IOException ex) {
    Logger.getLogger(ModeInGame.class.getName()).log(Level.SEVERE,null,ex);
  }
  Input.update();
  ClientEventManager.update();
  EventManager.update();
  model.update();
  fx.update();
  view.render();
  fx.render();
  get_ui().update();
  get_ui().render();
  DebugOverlay.debugPathfinding();
  overlay.render();
}
Program: 153727
Project: 153727
Buggy source:
public void run(){
  IGameMode mode=null;
  Io.init();
  try {
    WindowRender.create();
    while (running) {
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
      mode=Game.get_game_mode();
      Timer.tick();
      mode.update();
      Display.sync(60);
      Display.update();
      if (Display.isCloseRequested()) {
        if (Player.get_ent() != null) {
          EPlayerLogout event=new EPlayerLogout();
          event.post();
        }
        running=false;
      }
    }
    System.out.println("String_Node_Str");
    WindowRender.destroy();
    Main.neServer.destroy();
    NettyClient.destroy();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  IGameMode mode=null;
  Io.init();
  try {
    WindowRender.create();
    while (running) {
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
      mode=Game.get_game_mode();
      Timer.tick();
      mode.update();
      Main.neServer.update();
      Display.sync(60);
      Display.update();
      if (Display.isCloseRequested()) {
        if (Player.get_ent() != null) {
          EPlayerLogout event=new EPlayerLogout();
          event.post();
        }
        running=false;
      }
    }
    System.out.println("String_Node_Str");
    WindowRender.destroy();
    Main.neServer.destroy();
    NettyClient.destroy();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 153728
Project: 153728
Buggy source:
public static void drawLine(int x1,int y1,int x2,int y2,Color color){
  System.out.println("String_Node_Str" + x1 + "String_Node_Str"+ y1+ "String_Node_Str"+ x2+ "String_Node_Str"+ y2+ "String_Node_Str");
  glEnable(GL_POINT_SMOOTH);
  glDisable(GL_TEXTURE_2D);
  glLineWidth(4);
  glBegin(GL_LINES);
  glColor3f(color.r,color.g,color.b);
  glVertex2f(x1,y1);
  glVertex2f(x2,y2);
  glEnd();
  glPointSize(8);
  glBegin(GL_POINTS);
  glColor3f(1,0,0);
  glVertex2f(x2,y2);
  glEnd();
  glEnable(GL_TEXTURE_2D);
}

Fixed version (ground truth):
public static void drawLine(int x1,int y1,int x2,int y2,Color color){
  glEnable(GL_POINT_SMOOTH);
  glDisable(GL_TEXTURE_2D);
  glLineWidth(4);
  glBegin(GL_LINES);
  glColor3f(color.r,color.g,color.b);
  glVertex2f(x1,y1);
  glVertex2f(x2,y2);
  glEnd();
  glPointSize(8);
  glBegin(GL_POINTS);
  glColor3f(1,0,0);
  glVertex2f(x2,y2);
  glEnd();
  glEnable(GL_TEXTURE_2D);
}
Program: 153729
Project: 153729
Buggy source:
public AServerIoLayer(String name){
  this.name=name;
  allChannels=new DefaultChannelGroup(name);
}

Fixed version (ground truth):
public AServerIoLayer(String name){
  this.name=name;
  allChannels=new DefaultChannelGroup(name);
  packets=new ArrayList<NEDataPacket>();
}
Program: 153730
Project: 153730
Buggy source:
public void update(){
  for (  NEDataPacket packet : packets) {
    handlePacket(packet);
  }
}

Fixed version (ground truth):
public void update(){
  for (  NEDataPacket packet : packets) {
    handlePacket(packet);
  }
  packets.clear();
}
Program: 153731
Project: 153731
Buggy source:
public void update(){
  gameServer.update();
}

Fixed version (ground truth):
public void update(){
  charServer.update();
  gameServer.update();
}
Program: 153732
Project: 153732
Buggy source:
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(8192,Delimiters.lineDelimiter()));
  pipeline.addLast("String_Node_Str",new StringDecoder());
  pipeline.addLast("String_Node_Str",new StringEncoder());
  pipeline.addLast("String_Node_Str",new CharServerHandler(server));
  return pipeline;
}

Fixed version (ground truth):
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline=Channels.pipeline();
  pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(8192,Delimiters.lineDelimiter()));
  pipeline.addLast("String_Node_Str",new StringDecoder());
  pipeline.addLast("String_Node_Str",new StringEncoder());
  pipeline.addLast("String_Node_Str",handler);
  return pipeline;
}
Program: 153733
Project: 153733
Buggy source:
public void run(){
  System.out.println("String_Node_Str" + Io.CHAR_SERVER_PORT);
  nio_factory=new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool());
  bootstrap=new ServerBootstrap(nio_factory);
  factory=new ChannelPipelineFactory(){
    CharServer server=CharServer.this;
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline=Channels.pipeline();
      pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(8192,Delimiters.lineDelimiter()));
      pipeline.addLast("String_Node_Str",new StringDecoder());
      pipeline.addLast("String_Node_Str",new StringEncoder());
      pipeline.addLast("String_Node_Str",new CharServerHandler(server));
      return pipeline;
    }
  }
;
  bootstrap.setPipelineFactory(factory);
  Channel srvChannel=bootstrap.bind(new InetSocketAddress(Io.CHAR_SERVER_PORT));
  allChannels.add(srvChannel);
}

Fixed version (ground truth):
public void run(){
  System.out.println("String_Node_Str" + Io.CHAR_SERVER_PORT);
  nio_factory=new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),Executors.newCachedThreadPool());
  bootstrap=new ServerBootstrap(nio_factory);
  handler=new CharServerHandler(this);
  factory=new ChannelPipelineFactory(){
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline=Channels.pipeline();
      pipeline.addLast("String_Node_Str",new DelimiterBasedFrameDecoder(8192,Delimiters.lineDelimiter()));
      pipeline.addLast("String_Node_Str",new StringDecoder());
      pipeline.addLast("String_Node_Str",new StringEncoder());
      pipeline.addLast("String_Node_Str",handler);
      return pipeline;
    }
  }
;
  bootstrap.setPipelineFactory(factory);
  Channel srvChannel=bootstrap.bind(new InetSocketAddress(Io.CHAR_SERVER_PORT));
  allChannels.add(srvChannel);
}
Program: 153734
Project: 153734
Buggy source:
@Override protected void handlePacket(NEDataPacket packet){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void handlePacket(NEDataPacket packet){
  String[] data=packet.getData();
  Channel ioChannel=packet.getChannel();
  if (data.length == 0) {
    return;
  }
  String eventType=data[0];
  System.err.println("String_Node_Str" + eventType + "String_Node_Str");
  if (eventType.equals("String_Node_Str")) {
    ServerUserPool.registerUser(ioChannel,"String_Node_Str");
    handler.sendMsg("String_Node_Str",ioChannel);
  }
  if (eventType.equals("String_Node_Str")) {
    String gameServerHost="String_Node_Str";
    int gameServerPort=Io.GAME_SERVER_PORT;
    User user=ServerUserPool.getUser(ioChannel);
    int user_id=user.getId();
    handler.sendMsg("String_Node_Str" + gameServerHost + "String_Node_Str"+ gameServerPort+ "String_Node_Str"+ user_id,ioChannel);
  }
}
Program: 153735
Project: 153735
Buggy source:
public void update(){
  try {
    Io.update();
  }
 catch (  IOException ex) {
    Logger.getLogger(ModeInGame.class.getName()).log(Level.SEVERE,null,ex);
  }
  Input.update();
  EventManager.update();
  model.update();
  fx.update();
  view.render();
  fx.render();
  get_ui().update();
  get_ui().render();
  overlay.render();
}

Fixed version (ground truth):
public void update(){
  try {
    Io.update();
  }
 catch (  IOException ex) {
    Logger.getLogger(ModeInGame.class.getName()).log(Level.SEVERE,null,ex);
  }
  Input.update();
  EventManager.update();
  model.update();
  fx.update();
  view.render();
  fx.render();
  get_ui().update();
  get_ui().render();
  DebugOverlay.debugPathfinding();
  overlay.render();
}
Program: 153737
Project: 153737
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,25,"String_Node_Str" + WorldTimer.datetime.getTime(),Color.white);
  Point tileFrom=new Point(0,0);
  Point tileTo=new Point(0,0);
  Entity[] entList=EntityManager.getEntities(WorldView.get_zindex());
  for (  Entity ent : entList) {
    IEntityController controller=ent.controller;
    if (ent == Player.get_ent() && controller != null && controller instanceof NpcController) {
      NpcController npc_controller=(NpcController)controller;
      if (npc_controller.path == null) {
        continue;
      }
      if (npc_controller.path.steps.size() > 1) {
        System.out.println("String_Node_Str" + npc_controller.path.steps.size() + "String_Node_Str");
      }
      Step prevStep=new Step(ent.origin.getX(),ent.origin.getY());
      for (      Step step : (ArrayList<Step>)(npc_controller.path).steps) {
        if (step == npc_controller.path.steps.get(0)) {
          continue;
        }
        tileFrom.setLocation(prevStep);
        tileFrom=WorldModel.getWorldLayer(WorldView.get_zindex()).tile_map.local2world(tileFrom);
        tileTo.setLocation(step);
        tileTo=WorldModel.getWorldLayer(WorldView.get_zindex()).tile_map.local2world(tileTo);
        OverlaySystem.drawLine(tileFrom,tileTo,Color.red);
        prevStep=step;
      }
    }
  }
  OverlaySystem.ttf.drawString(10,70,"String_Node_Str" + Integer.toString(Timer.get_fps()),Color.white);
  OverlaySystem.ttf.drawString(10,90,"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);
  OverlaySystem.ttf.drawString(WindowRender.get_window_w() - 100,10,"String_Node_Str" + WorldView.get_zindex(),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);
  OverlaySystem.ttf.drawString(10,25,"String_Node_Str" + WorldTimer.datetime.getTime(),Color.white);
  OverlaySystem.ttf.drawString(10,70,"String_Node_Str" + Integer.toString(Timer.get_fps()),Color.white);
  OverlaySystem.ttf.drawString(10,90,"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);
  OverlaySystem.ttf.drawString(WindowRender.get_window_w() - 100,10,"String_Node_Str" + WorldView.get_zindex(),Color.white);
}
Program: 153738
Project: 153738
Buggy source:
public static void drawLine(int x1,int y1,int x2,int y2,Color color){
  glLineWidth(4.0f);
  glColor3f(color.r,color.g,color.b);
  glBegin(GL_LINE);
  glVertex2d(x1,y1);
  glVertex2d(x2,y2);
  glEnd();
  glLineWidth(1.0f);
}

Fixed version (ground truth):
public static void drawLine(int x1,int y1,int x2,int y2,Color color){
  System.out.println("String_Node_Str" + x1 + "String_Node_Str"+ y1+ "String_Node_Str"+ x2+ "String_Node_Str"+ y2+ "String_Node_Str");
  glEnable(GL_POINT_SMOOTH);
  glDisable(GL_TEXTURE_2D);
  glLineWidth(4);
  glBegin(GL_LINES);
  glColor3f(color.r,color.g,color.b);
  glVertex2f(x1,y1);
  glVertex2f(x2,y2);
  glEnd();
  glPointSize(8);
  glBegin(GL_POINTS);
  glColor3f(1,0,0);
  glVertex2f(x2,y2);
  glEnd();
  glEnable(GL_TEXTURE_2D);
}
Program: 153740
Project: 153740
Buggy source:
private static void e_on_new_hour(){
  if (is_night()) {
    int chance=(int)(Math.random() * 100);
    if (chance < 90) {
      Point spawn_point=new Point(Player.get_ent().origin.getX() + (int)(Math.random() * 60 - 30),Player.get_ent().origin.getY() + (int)(Math.random() * 60 - 30));
      if (WorldCluster.tile_in_cluster(spawn_point.getX(),spawn_point.getY())) {
        if (!WorldViewCamera.tile_in_fov(spawn_point)) {
          return;
        }
      }
 else {
        return;
      }
      WorldTile tile=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(spawn_point.getX(),spawn_point.getY());
      if (tile == null || tile.light_level > 0.5f) {
        return;
      }
      Zombie zombie=new Zombie();
      zombie.setLayerId(WorldLayer.GROUND_LAYER);
      zombie.spawn(spawn_point);
      zombie.set_ai(new BasicMobAI());
    }
  }
}

Fixed version (ground truth):
private static void e_on_new_hour(){
  if (is_night()) {
    int chance=(int)(Math.random() * 100);
    if (chance < 90 && Player.get_ent() != null) {
      Point spawn_point=new Point(Player.get_ent().origin.getX() + (int)(Math.random() * 60 - 30),Player.get_ent().origin.getY() + (int)(Math.random() * 60 - 30));
      if (WorldCluster.tile_in_cluster(spawn_point.getX(),spawn_point.getY())) {
        if (!WorldViewCamera.tile_in_fov(spawn_point)) {
          return;
        }
      }
 else {
        return;
      }
      WorldTile tile=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(spawn_point.getX(),spawn_point.getY());
      if (tile == null || tile.light_level > 0.5f) {
        return;
      }
      Zombie zombie=new Zombie();
      zombie.setLayerId(WorldLayer.GROUND_LAYER);
      zombie.spawn(spawn_point);
      zombie.set_ai(new BasicMobAI());
    }
  }
}
Program: 153741
Project: 153741
Buggy source:
@Override public void post(){
  WorldTile tile=WorldModel.get_tile(this.to.getX(),this.to.getY());
  if (!tile.is_blocked()) {
    super.post();
  }
}

Fixed version (ground truth):
@Override public void post(){
  WorldTile tile=entity.getLayer().get_tile(this.to.getX(),this.to.getY());
  if (!tile.is_blocked()) {
    super.post();
  }
}
Program: 153742
Project: 153742
Buggy source:
@Override public void post(){
  WorldTile tile=WorldModel.get_tile(this.to.getX(),this.to.getY());
  if (tile != null && !tile.is_blocked()) {
    super.post();
  }
}

Fixed version (ground truth):
@Override public void post(){
  WorldTile tile=entity.getLayer().get_tile(this.to.getX(),this.to.getY());
  if (tile != null && !tile.is_blocked()) {
    super.post();
  }
}
Program: 153743
Project: 153743
Buggy source:
@Override public void e_on_change_item(){
  if (get_active_item() != null && get_active_item().get_type().equals("String_Node_Str")) {
    light_amt=4.0f;
    WorldModel.invalidate_light();
  }
 else {
    if (light_amt != 0.0f) {
      light_amt=0.0f;
      WorldModel.invalidate_light();
    }
  }
}

Fixed version (ground truth):
@Override public void e_on_change_item(){
  if (get_active_item() != null && get_active_item().get_type().equals("String_Node_Str")) {
    light_amt=4.0f;
    WorldLayer.invalidate_light();
  }
 else {
    if (light_amt != 0.0f) {
      light_amt=0.0f;
      WorldLayer.invalidate_light();
    }
  }
}
Program: 153744
Project: 153744
Buggy source:
public EntityPlayer(){
  Combat __combat=new BasicCombat();
  __combat.set_hp(500);
  set_blocking(true);
  set_combat(__combat);
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",16));
  this.container.add_item(BaseItem.produce("String_Node_Str",2));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",10));
  this.container.add_item(BaseItem.produce("String_Node_Str",1).set_slot("String_Node_Str"));
}

Fixed version (ground truth):
public EntityPlayer(){
  Combat __combat=new BasicCombat();
  __combat.set_hp(500);
  set_blocking(true);
  set_combat(__combat);
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",2));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",10));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",1).set_slot("String_Node_Str"));
}
Program: 153745
Project: 153745
Buggy source:
public static void init(){
  if (!is_empty()) {
    return;
  }
  links.put("String_Node_Str",EntFire.class);
  links.put("String_Node_Str",EntFence.class);
  links.put("String_Node_Str",EntWoodWall.class);
  links.put("String_Node_Str",EntWoodFloor.class);
  links.put("String_Node_Str",EntChest.class);
  links.put("String_Node_Str",EntSignpost.class);
  links.put("String_Node_Str",EntTotem.class);
}

Fixed version (ground truth):
public static void init(){
  if (!is_empty()) {
    return;
  }
  links.put("String_Node_Str",EntFire.class);
  links.put("String_Node_Str",EntFence.class);
  links.put("String_Node_Str",EntWoodWall.class);
  links.put("String_Node_Str",EntWoodFloor.class);
  links.put("String_Node_Str",EntChest.class);
  links.put("String_Node_Str",EntSignpost.class);
  links.put("String_Node_Str",EntTotem.class);
  links.put("String_Node_Str",EntLadder.class);
}
Program: 153746
Project: 153746
Buggy source:
@Override public EntityRenderer build_render(){
  final EntFence __owner=this;
  SpriteRenderer __render=new SpriteRenderer(){
    EntFence ent;
{
      this.ent=__owner;
    }
    @Override public void render(){
      tile_id=get_tile_id();
      super.render();
    }
    public int get_tile_id(){
      int id=0;
      boolean t=WorldModel.get_tile(ent.x(),ent.y() - 1).has_ent(EntFence.class);
      boolean b=WorldModel.get_tile(ent.x(),ent.y() + 1).has_ent(EntFence.class);
      boolean l=WorldModel.get_tile(ent.x() - 1,ent.y()).has_ent(EntFence.class);
      boolean r=WorldModel.get_tile(ent.x() + 1,ent.y()).has_ent(EntFence.class);
      if (t) {
        id=1;
        if (r) {
          if (!l && !b) {
            id=4;
          }
 else {
            id=2;
          }
        }
        if (l) {
          if (!r && !b) {
            id=5;
          }
 else {
            id=2;
          }
        }
      }
      if (b) {
        id=1;
        if (r) {
          if (!l && !t) {
            id=3;
          }
 else {
            id=2;
          }
        }
        if (l) {
          if (!r && !t) {
            id=6;
          }
 else {
            id=2;
          }
        }
      }
      return id;
    }
  }
;
  __render.set_texture("String_Node_Str");
  __render.get_tileset().sprite_w=60;
  __render.get_tileset().sprite_h=60;
  __render.get_tileset().TILESET_W=3;
  __render.get_tileset().TILESET_H=3;
  return __render;
}

Fixed version (ground truth):
@Override public EntityRenderer build_render(){
  final EntFence __owner=this;
  SpriteRenderer __render=new SpriteRenderer(){
    EntFence ent;
{
      this.ent=__owner;
    }
    @Override public void render(){
      tile_id=get_tile_id();
      super.render();
    }
    public int get_tile_id(){
      int id=0;
      boolean t=getLayer().get_tile(ent.x(),ent.y() - 1).has_ent(EntFence.class);
      boolean b=getLayer().get_tile(ent.x(),ent.y() + 1).has_ent(EntFence.class);
      boolean l=getLayer().get_tile(ent.x() - 1,ent.y()).has_ent(EntFence.class);
      boolean r=getLayer().get_tile(ent.x() + 1,ent.y()).has_ent(EntFence.class);
      if (t) {
        id=1;
        if (r) {
          if (!l && !b) {
            id=4;
          }
 else {
            id=2;
          }
        }
        if (l) {
          if (!r && !b) {
            id=5;
          }
 else {
            id=2;
          }
        }
      }
      if (b) {
        id=1;
        if (r) {
          if (!l && !t) {
            id=3;
          }
 else {
            id=2;
          }
        }
        if (l) {
          if (!r && !t) {
            id=6;
          }
 else {
            id=2;
          }
        }
      }
      return id;
    }
    private WorldLayer getLayer(){
      return WorldModel.getWorldLayer(Player.get_zindex());
    }
  }
;
  __render.set_texture("String_Node_Str");
  __render.get_tileset().sprite_w=60;
  __render.get_tileset().sprite_h=60;
  __render.get_tileset().TILESET_W=3;
  __render.get_tileset().TILESET_H=3;
  return __render;
}
Program: 153747
Project: 153747
Buggy source:
public int get_tile_id(){
  int id=0;
  boolean t=WorldModel.get_tile(ent.x(),ent.y() - 1).has_ent(EntFence.class);
  boolean b=WorldModel.get_tile(ent.x(),ent.y() + 1).has_ent(EntFence.class);
  boolean l=WorldModel.get_tile(ent.x() - 1,ent.y()).has_ent(EntFence.class);
  boolean r=WorldModel.get_tile(ent.x() + 1,ent.y()).has_ent(EntFence.class);
  if (t) {
    id=1;
    if (r) {
      if (!l && !b) {
        id=4;
      }
 else {
        id=2;
      }
    }
    if (l) {
      if (!r && !b) {
        id=5;
      }
 else {
        id=2;
      }
    }
  }
  if (b) {
    id=1;
    if (r) {
      if (!l && !t) {
        id=3;
      }
 else {
        id=2;
      }
    }
    if (l) {
      if (!r && !t) {
        id=6;
      }
 else {
        id=2;
      }
    }
  }
  return id;
}

Fixed version (ground truth):
public int get_tile_id(){
  int id=0;
  boolean t=getLayer().get_tile(ent.x(),ent.y() - 1).has_ent(EntFence.class);
  boolean b=getLayer().get_tile(ent.x(),ent.y() + 1).has_ent(EntFence.class);
  boolean l=getLayer().get_tile(ent.x() - 1,ent.y()).has_ent(EntFence.class);
  boolean r=getLayer().get_tile(ent.x() + 1,ent.y()).has_ent(EntFence.class);
  if (t) {
    id=1;
    if (r) {
      if (!l && !b) {
        id=4;
      }
 else {
        id=2;
      }
    }
    if (l) {
      if (!r && !b) {
        id=5;
      }
 else {
        id=2;
      }
    }
  }
  if (b) {
    id=1;
    if (r) {
      if (!l && !t) {
        id=3;
      }
 else {
        id=2;
      }
    }
    if (l) {
      if (!r && !t) {
        id=6;
      }
 else {
        id=2;
      }
    }
  }
  return id;
}
Program: 153748
Project: 153748
Buggy source:
@Override public void e_on_obstacle(int x,int y){
  Entity actor=WorldModel.get_tile(x,y).get_actor();
  if (actor != null && owner.get_combat() != null) {
    owner.get_combat().inflict_damage(actor);
  }
}

Fixed version (ground truth):
@Override public void e_on_obstacle(int x,int y){
  Entity actor=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(x,y).get_actor();
  if (actor != null && owner.get_combat() != null) {
    owner.get_combat().inflict_damage(actor);
  }
}
Program: 153749
Project: 153749
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);
  try {
    path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    path=null;
  }
  step=null;
  if (path != null && path.getLength() >= 1) {
    path.steps.remove(0);
  }
}

Fixed version (ground truth):
public void calculate_path(int x,int y){
  Point target=new Point(x,y);
  target=WorldModel.getWorldLayer(Player.get_zindex()).tile_map.world2local(target);
  Point source=new Point(owner.origin);
  source=WorldModel.getWorldLayer(Player.get_zindex()).tile_map.world2local(source);
  try {
    path=finder.findPath(this,source.getX(),source.getY(),target.getX(),target.getY());
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    path=null;
  }
  step=null;
  if (path != null && path.getLength() >= 1) {
    path.steps.remove(0);
  }
}
Program: 153750
Project: 153750
Buggy source:
private void notify_path(Step __step){
  Point __dest=new Point(__step.getX(),__step.getY());
  __dest=WorldModel.tile_map.local2world(__dest);
  EEntitySetPath dest_event=new EEntitySetPath(owner,__dest);
  dest_event.post();
}

Fixed version (ground truth):
private void notify_path(Step __step){
  Point __dest=new Point(__step.getX(),__step.getY());
  __dest=WorldModel.getWorldLayer(Player.get_zindex()).tile_map.local2world(__dest);
  EEntitySetPath dest_event=new EEntitySetPath(owner,__dest);
  dest_event.post();
}
Program: 153751
Project: 153751
Buggy source:
public void move_ent(int x,int y){
  WorldTile tile=WorldModel.get_tile(x,y);
  if (tile == null) {
    return;
  }
  if (tile.is_blocked()) {
    step=null;
    path=null;
    destination=null;
    e_on_obstacle(x,y);
    return;
  }
  float dx=(float)(x - owner.origin.getX()) * MOVE_SPEED * tile.get_speed_modifier();
  float dy=(float)(y - owner.origin.getY()) * MOVE_SPEED * tile.get_speed_modifier();
  owner.dx+=dx;
  owner.dy+=dy;
  if (owner.dx > 1.0f || owner.dx < -1.0f || owner.dy > 1.0f || owner.dy < -1.0f) {
    change_tile(owner.x() + (int)owner.dx,owner.y() + (int)owner.dy);
    return;
  }
}

Fixed version (ground truth):
public void move_ent(int x,int y){
  WorldTile tile=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(x,y);
  if (tile == null) {
    return;
  }
  if (tile.is_blocked()) {
    step=null;
    path=null;
    destination=null;
    e_on_obstacle(x,y);
    return;
  }
  float dx=(float)(x - owner.origin.getX()) * MOVE_SPEED * tile.get_speed_modifier();
  float dy=(float)(y - owner.origin.getY()) * MOVE_SPEED * tile.get_speed_modifier();
  owner.dx+=dx;
  owner.dy+=dy;
  if (owner.dx > 1.0f || owner.dx < -1.0f || owner.dy > 1.0f || owner.dy < -1.0f) {
    change_tile(owner.x() + (int)owner.dx,owner.y() + (int)owner.dy);
    return;
  }
}
Program: 153752
Project: 153752
Buggy source:
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());
  }
  int dx=0;
  int dy=0;
  if (owner.origin.getX() > __destination.getX()) {
    dx=-1;
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    dx=1;
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    dy=-1;
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    dy=1;
    owner.orientation=Orientation.ORIENT_S;
  }
  move_ent(owner.origin.getX() + dx,owner.origin.getY() + dy);
  if (owner.get_render() instanceof NPCRenderer && 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.getWorldLayer(Player.get_zindex()).tile_map.local2world(location);
    __destination.setLocation(location.getX(),location.getY());
  }
  int dx=0;
  int dy=0;
  if (owner.origin.getX() > __destination.getX()) {
    dx=-1;
    owner.orientation=Orientation.ORIENT_W;
  }
  if (owner.origin.getX() < __destination.getX()) {
    dx=1;
    owner.orientation=Orientation.ORIENT_E;
  }
  if (owner.origin.getY() > __destination.getY()) {
    dy=-1;
    owner.orientation=Orientation.ORIENT_N;
  }
  if (owner.origin.getY() < __destination.getY()) {
    dy=1;
    owner.orientation=Orientation.ORIENT_S;
  }
  move_ent(owner.origin.getX() + dx,owner.origin.getY() + dy);
  if (owner.get_render() instanceof NPCRenderer && owner.origin.equals(destination)) {
    this.destination=null;
    step=null;
    path=null;
    ((NPCRenderer)owner.get_render()).set_frame(0);
  }
}
Program: 153753
Project: 153753
Buggy source:
@Override public void e_on_obstacle(int x,int y){
  if (!Player.is_combat_mode()) {
    return;
  }
  Entity obstacle=WorldModel.get_tile(x,y).get_obstacle();
  if (obstacle != null && owner.get_combat() != null) {
    owner.get_combat().inflict_damage(obstacle);
  }
}

Fixed version (ground truth):
@Override public void e_on_obstacle(int x,int y){
  if (!Player.is_combat_mode()) {
    return;
  }
  Entity obstacle=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(x,y).get_obstacle();
  if (obstacle != null && owner.get_combat() != null) {
    owner.get_combat().inflict_damage(obstacle);
  }
}
Program: 153754
Project: 153754
Buggy source:
public void e_on_mouse_click(EMouseClick event){
  Point tile_origin=view.getTileCoord(event.origin);
  if (event.type == MouseInputType.LCLICK) {
    WorldTile tile=WorldModel.get_tile(tile_origin.getX(),tile_origin.getY());
    if (tile == null) {
      return;
    }
    Entity ent=tile.get_actor();
    if (ent != null && ent instanceof EntMonster) {
      Player.attack(ent);
    }
 else {
      Player.move(tile_origin);
    }
  }
}

Fixed version (ground truth):
public void e_on_mouse_click(EMouseClick event){
  Point tile_origin=view.getTileCoord(event.origin);
  if (event.type == MouseInputType.LCLICK) {
    WorldTile tile=WorldModel.getWorldLayer(Player.get_zindex()).get_tile(tile_origin.getX(),tile_origin.getY());
    if (tile == null) {
      return;
    }
    Entity ent=tile.get_actor();
    if (ent != null && ent instanceof EntMonster) {
      Player.attack(ent);
    }
 else {
      Player.move(tile_origin);
    }
  }
}
Program: 153757
Project: 153757
Buggy source:
public NE_GUI_Element get_gui_element(int mx,int my){
  if (is_client_rect(mx,my)) {
    Object[] elem=children.toArray();
    for (int i=0; i < elem.length; i++) {
      NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
      NE_GUI_Element child_subelem=__elem.get_gui_element(mx,my);
      if (child_subelem != null) {
        return child_subelem;
      }
      if (__elem.is_client_rect(mx,my)) {
        return __elem;
      }
    }
    return this;
  }
  return null;
}

Fixed version (ground truth):
public NE_GUI_Element get_gui_element(int mx,int my){
  if (is_client_rect(mx,my)) {
    Object[] elem=children.toArray();
    for (int i=0; i < elem.length; i++) {
      NE_GUI_Element __elem=(NE_GUI_Element)elem[i];
      NE_GUI_Element child_subelem=__elem.get_gui_element(mx,my);
      if (child_subelem != null && child_subelem.visible) {
        return child_subelem;
      }
      if (__elem.is_client_rect(mx,my)) {
        return __elem;
      }
    }
    return this;
  }
  return null;
}
Program: 153758
Project: 153758
Buggy source:
public EntityPlayer(){
  Combat __combat=new BasicCombat();
  __combat.set_hp(500);
  set_blocking(true);
  set_combat(__combat);
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",16));
  this.container.add_item(BaseItem.produce("String_Node_Str",2));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",1).set_slot("String_Node_Str"));
}

Fixed version (ground truth):
public EntityPlayer(){
  Combat __combat=new BasicCombat();
  __combat.set_hp(500);
  set_blocking(true);
  set_combat(__combat);
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",20));
  this.container.add_item(BaseItem.produce("String_Node_Str",1));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",16));
  this.container.add_item(BaseItem.produce("String_Node_Str",2));
  this.container.add_item(BaseItem.produce("String_Node_Str",64));
  this.container.add_item(BaseItem.produce("String_Node_Str",10));
  this.container.add_item(BaseItem.produce("String_Node_Str",1).set_slot("String_Node_Str"));
}
Program: 153759
Project: 153759
Buggy source:
public void drop(){
  if (container == null) {
    System.err.println("String_Node_Str");
    return;
  }
  container.remove_item(this);
}

Fixed version (ground truth):
public void drop(){
  if (container == null) {
    System.err.println("String_Node_Str");
    return;
  }
  System.err.println("String_Node_Str" + container);
  container.remove_item(this);
}
Program: 153760
Project: 153760
Buggy source:
public void put_from(BaseItem src){
  int to_remove=get_space();
  if (to_remove > src.get_count()) {
    to_remove=src.get_count();
  }
  System.out.println("String_Node_Str" + Integer.toString(to_remove));
  System.out.println("String_Node_Str" + Integer.toString(src.count));
  src.set_count(src.get_count() - to_remove);
  System.out.println("String_Node_Str" + Integer.toString(src.count));
  this.add_count(to_remove);
}

Fixed version (ground truth):
public void put_from(BaseItem src){
  int to_remove=get_space();
  if (to_remove > src.get_count()) {
    to_remove=src.get_count();
  }
  System.out.println("String_Node_Str" + Integer.toString(to_remove));
  System.out.println("String_Node_Str" + Integer.toString(src.count));
  System.out.println("String_Node_Str" + Integer.toString(src.count));
  this.add_count(to_remove);
  src.drop();
}
Program: 153761
Project: 153761
Buggy source:
public void del_count(int count){
  set_count(this.count - count);
  if (this.count <= 0) {
    drop();
  }
}

Fixed version (ground truth):
public void del_count(int count){
  set_count(this.count - count);
  if (this.count <= 0) {
    System.out.println("String_Node_Str");
    drop();
  }
}
Program: 153762
Project: 153762
Buggy source:
public void remove_item(BaseItem item){
  int remove_count=item.count;
  BaseItem[] elem=items.toArray(new BaseItem[0]);
  for (int i=0; i < elem.length; i++) {
    if (elem[i].type.equals(item.type)) {
      if (elem[i].count <= remove_count) {
        remove_count-=elem[i].count;
        items.remove(elem[i]);
      }
 else {
        elem[i].del_count(remove_count);
        remove_count=0;
      }
    }
  }
  on_update();
}

Fixed version (ground truth):
public void remove_item(BaseItem item){
  int remove_count=item.count;
  System.out.println("String_Node_Str" + remove_count + "String_Node_Str");
  BaseItem[] elem=items.toArray(new BaseItem[0]);
  for (int i=0; i < elem.length; i++) {
    if (elem[i].type.equals(item.type)) {
      if (elem[i].count <= remove_count) {
        remove_count-=elem[i].count;
        items.remove(elem[i]);
      }
 else {
        elem[i].del_count(remove_count);
        remove_count=0;
      }
    }
  }
  on_update();
}
Program: 153763
Project: 153763
Buggy source:
@Override public void e_on_mouse_click(EMouseClick e){
  if (e.type == MouseInputType.RCLICK) {
    context_popup(e);
  }
}

Fixed version (ground truth):
@Override public void e_on_mouse_click(EMouseClick e){
  if (e.type == MouseInputType.RCLICK) {
    context_popup(e);
  }
  if (e.type == MouseInputType.LCLICK) {
    Game.get_ui_root().remove(get_inventory_ctrl());
    Game.get_ui_root().add(get_inventory_ctrl());
  }
}
Program: 153764
Project: 153764
Buggy source:
@Override public void e_on_drop(){
  this.w=32;
  this.h=32;
  WorldView.highlight_tile(null);
  NE_GUI_Element __parent=parent.parent;
  NE_GUI_Inventory inventory=(NE_GUI_Inventory)__parent;
  inventory.update(inventory.container);
}

Fixed version (ground truth):
@Override public void e_on_drop(){
  this.w=32;
  this.h=32;
  WorldView.highlight_tile(null);
  NE_GUI_Inventory inventory=get_inventory_ctrl();
  inventory.update(inventory.container);
}
Program: 153765
Project: 153765
Buggy source:
@Override public void e_on_drag(){
  this.w=24;
  this.h=24;
  int x=Mouse.getX();
  int y=Mouse.getY();
  Point tile_coord=WorldView.getTileCoord(x,y);
  System.out.println("String_Node_Str" + tile_coord);
  WorldView.highlight_tile(tile_coord);
}

Fixed version (ground truth):
@Override public void e_on_drag(){
  this.w=24;
  this.h=24;
  int x=Mouse.getX();
  int y=Mouse.getY();
  Point tile_coord=WorldView.getTileCoord(x,y);
  WorldView.highlight_tile(tile_coord);
}
Program: 153766
Project: 153766
Buggy source:
@Override public void render(){
  area_renderer.render(get_x(),get_y(),w,h);
}

Fixed version (ground truth):
@Override public void render(){
  area_renderer.render(get_x(),get_y(),w,h);
  super.render();
}
Program: 153767
Project: 153767
Buggy source:
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 (is_client_rect(mx,my)) {
      if (!solid) {
        return;
      }
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease) {
    if (drag_start) {
      drop();
    }
    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 EGUIDrop) {
    EGUIDrop event=(EGUIDrop)e;
    if (is_client_rect(event.coord.getX(),event.coord.getY())) {
      e_on_grab(event);
    }
  }
  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 (is_client_rect(mx,my)) {
      if (!solid) {
        return;
      }
      e.dispatch();
      e_on_mouse_click(event);
      drag_start=true;
    }
 else {
      e_on_mouse_out_click(event);
    }
  }
  if (e instanceof EMouseRelease && !e.is_dispatched()) {
    if (drag_start) {
      drop();
    }
    drag_start=false;
  }
  if (e instanceof EMouseDrag && !e.is_dispatched()) {
    EMouseDrag event=(EMouseDrag)e;
    if (drag_start && dragable) {
      drag((int)event.dx,(int)event.dy);
    }
  }
  if (e instanceof EGUIDrop && !e.is_dispatched()) {
    EGUIDrop event=(EGUIDrop)e;
    if (is_client_rect(event.coord.getX(),event.coord.getY())) {
      e_on_grab(event);
    }
  }
  if (e instanceof EKeyPress) {
    EKeyPress event=(EKeyPress)e;
    e_on_key_press(event);
  }
}
Program: 153768
Project: 153768
Buggy source:
public void render(){
  DebugOverlay.render();
  TileCoordOverlay.render();
}

Fixed version (ground truth):
public void render(){
  DebugOverlay.render();
  TileCoordOverlay.render();
  VersionOverlay.render();
}