nus-yam/ex-repair huggingface dataset:
Program: 99118
Project: 99118
Buggy source:
public void onInitialize(){
  long start=System.nanoTime();
  model1=GameObjectManager.loadModel("String_Node_Str");
  terrain=GameObjectManager.createTerrain("String_Node_Str",60,500);
  terrain.setBaseTexture(GameObjectManager.loadTexture2D("String_Node_Str"));
  keyLight=new Light();
  keyLight.setForward(-1,-1,-1);
  keyLight.setIntensity(1);
  backLight=new Light();
  backLight.setIntensity(3);
  fillLight=new Light();
  fillLight.setForward(-1,0,-0.45f);
  fillLight.setIntensity(1.4f);
  pointLight=new Light(Light.POINT_LIGHT,50,1.2f);
  pointLight.setLightType(Light.POINT_LIGHT);
  pointLight.setPosition(250,250,80);
  camera=Scene.getMainCamera();
  camera.setPosition(350,350,100);
  camera.setLookAt(new Vector3(250,250,0));
  camera.setProjectionType(Camera.PERSPECTIVE);
  camera.setRange(1000);
  Animation animation1=model1.getAnimation();
  AnimationClip idle1=animation1.getAnimationClip("String_Node_Str");
  animation1.play("String_Node_Str");
  idle1.setPlaybackMode(PlaybackMode.LOOP);
  idle1.setStart(35);
  idle1.setEnd(50);
  model1.setPosition(250,250,40);
  addLayer(layer1);
  layer1.addChild(model1,camera,keyLight,fillLight,backLight,terrain);
  view1=GameObjectManager.createImageView("String_Node_Str");
  layer2.addChild(view1);
  float end=(System.nanoTime() - start) / 1000000f;
  log("String_Node_Str" + end + "String_Node_Str");
}

Fixed version (ground truth):
public void onInitialize(){
  long start=System.nanoTime();
  model1=GameObjectManager.loadModel("String_Node_Str");
  terrain=GameObjectManager.createTerrain("String_Node_Str",60,500);
  terrain.setBaseTexture(GameObjectManager.loadTexture2D("String_Node_Str"));
  keyLight=new Light();
  keyLight.setForward(-1,-1,-1);
  keyLight.setIntensity(1);
  backLight=new Light();
  backLight.setIntensity(3);
  fillLight=new Light();
  fillLight.setForward(-1,0,-0.45f);
  fillLight.setIntensity(1.4f);
  pointLight1=new Light(Light.POINT_LIGHT,40,2f,1,0,0);
  pointLight1.setPosition(-100,0,30);
  pointLight2=new Light(Light.POINT_LIGHT,40,2f,0,0,1);
  pointLight2.setPosition(100,0,30);
  camera=Scene.getMainCamera();
  camera.setPosition(350,350,100);
  camera.setLookAt(new Vector3(250,250,0));
  camera.setProjectionType(Camera.PERSPECTIVE);
  camera.setRange(1000);
  Animation animation1=model1.getAnimation();
  AnimationClip idle1=animation1.getAnimationClip("String_Node_Str");
  animation1.play("String_Node_Str");
  idle1.setPlaybackMode(PlaybackMode.LOOP);
  idle1.setStart(35);
  idle1.setEnd(50);
  model1.setPosition(250,250,40);
  model1.addChild(pointLight1,pointLight2);
  addLayer(layer1);
  layer1.addChild(model1,camera,keyLight,fillLight,backLight,terrain);
  view1=GameObjectManager.createImageView("String_Node_Str");
  layer2.addChild(view1);
  float end=(System.nanoTime() - start) / 1000000f;
  log("String_Node_Str" + end + "String_Node_Str");
}
Program: 99119
Project: 99119
Buggy source:
public void start(){
  createTerrainBuffer();
}

Fixed version (ground truth):
public void start(){
  createTerrainBuffer();
  Quad.createBuffer();
}
Program: 99120
Project: 99120
Buggy source:
private void drawImageView(ImageView view){
}

Fixed version (ground truth):
private void drawImageView(ImageView view){
  ShaderProgram shaderProgram=Shader.AMBIENT.getProgram(2);
  int program=shaderProgram.getProgramID();
  Vector2 position=view.getPosition();
  Vector2 scale=view.getScale();
  Matrix4 transformM=new Matrix4();
  Matrix4 mvp=Matrix4.multiply(orthogonalMVP,transformM);
  GLES20.glUseProgram(program);
  int vh=GLES20.glGetAttribLocation(program,"String_Node_Str");
  int uvh=GLES20.glGetAttribLocation(program,"String_Node_Str");
  float[] mvpm=new float[16];
  mvp.copyTo(mvpm);
  GLES20.glUniformMatrix4fv(GLES20.glGetUniformLocation(program,"String_Node_Str"),1,false,mvpm,0);
  GLES20.glEnableVertexAttribArray(vh);
  GLES20.glVertexAttribPointer(vh,2,GLES20.GL_FLOAT,false,0,Quad.getVertexBuffer());
  GLES20.glEnableVertexAttribArray(uvh);
  GLES20.glVertexAttribPointer(uvh,2,GLES20.GL_FLOAT,false,0,Quad.getUVBuffer());
  GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
  GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,view.getImageSrc().getTextureBuffer());
  GLES20.glUniform1i(GLES20.glGetUniformLocation(program,"String_Node_Str"),0);
  GLES20.glDrawElements(GLES20.GL_TRIANGLES,6,GLES20.GL_UNSIGNED_BYTE,Quad.getIndicesBuffer());
}
Program: 99121
Project: 99121
Buggy source:
public void drawScene(){
  if (hasChangedProjection) {
    if (mainCamera.getProjectionType() == Camera.PERSPECTIVE) {
      Matrix4.createFrustum(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
 else {
      Matrix4.createOrtho(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
    hasChangedProjection=false;
  }
  if (hasChangedModelView) {
    Matrix4 world=mainCamera.getWorldMatrix();
    Vector3 eye=world.getTranslation();
    Vector3 forward=world.getForward();
    target.x=eye.x + (forward.x * 10);
    target.y=eye.y + (forward.y * 10);
    target.z=eye.z + (forward.z * 10);
    Vector3 up=world.getUp();
    Matrix4.createLookAt(modelViewMatrix,eye,target,up);
    hasChangedModelView=false;
  }
  Matrix4.multiply(modelViewProjectionMatrix,projectionMatrix,modelViewMatrix);
  for (int i=0; i < getLayerCount(); i++) {
    recursiveLayer(getLayer(i));
  }
  GLES20.glEnable(GLES20.GL_DEPTH_TEST);
  GLES20.glDisable(GLES20.GL_CULL_FACE);
  drawTerrains();
  GLES20.glEnable(GLES20.GL_CULL_FACE);
  for (int i=0; i < models.size(); i++) {
    drawModel(models.get(i));
  }
  for (int i=0; i < imageViews.size(); i++) {
    drawImageView(imageViews.get(i));
  }
  imageViews.clear();
  models.clear();
  terrains.clear();
  lights.clear();
  float end=(System.nanoTime() - start) / 1000000f;
  Log.d("String_Node_Str",(1000f / end) + "String_Node_Str");
  start=System.nanoTime();
}

Fixed version (ground truth):
public void drawScene(){
  if (hasChangedProjection) {
    if (mainCamera.getProjectionType() == Camera.PERSPECTIVE) {
      Matrix4.createFrustum(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
 else {
      Matrix4.createOrtho(projectionMatrix,-ratio,ratio,-1,1,1,mainCamera.getRange());
    }
    hasChangedProjection=false;
  }
  if (hasChangedModelView) {
    Matrix4 world=mainCamera.getWorldMatrix();
    Vector3 eye=world.getTranslation();
    Vector3 forward=world.getForward();
    target.x=eye.x + (forward.x * 10);
    target.y=eye.y + (forward.y * 10);
    target.z=eye.z + (forward.z * 10);
    Vector3 up=world.getUp();
    Matrix4.createLookAt(modelViewMatrix,eye,target,up);
    hasChangedModelView=false;
  }
  Matrix4.multiply(modelViewProjectionMatrix,projectionMatrix,modelViewMatrix);
  for (int i=0; i < getLayerCount(); i++) {
    recursiveLayer(getLayer(i));
  }
  GLES20.glEnable(GLES20.GL_DEPTH_TEST);
  GLES20.glDisable(GLES20.GL_CULL_FACE);
  GLES20.glEnable(GLES20.GL_CULL_FACE);
  for (int i=0; i < models.size(); i++) {
  }
  GLES20.glEnable(GLES20.GL_BLEND);
  GLES20.glBlendFunc(GLES20.GL_ONE,GLES20.GL_ONE_MINUS_SRC_ALPHA);
  for (int i=0; i < imageViews.size(); i++) {
    drawImageView(imageViews.get(i));
  }
  GLES20.glDisable(GLES20.GL_BLEND);
  imageViews.clear();
  models.clear();
  terrains.clear();
  lights.clear();
  float end=(System.nanoTime() - start) / 1000000f;
  Log.d("String_Node_Str",(1000f / end) + "String_Node_Str");
  start=System.nanoTime();
}
Program: 99122
Project: 99122
Buggy source:
public static void onSurfaceChanged(){
  ratio=(float)Screen.getWidth() / Screen.getHeight();
  hasChangedProjection=true;
  Matrix4.createOrtho(orthogonalProjection,-ratio,ratio,-1,1,1,10);
  Matrix4.multiply(orthogonalMVP,orthogonalProjection,orthogonalModelView);
}

Fixed version (ground truth):
public static void onSurfaceChanged(){
  ratio=(float)Screen.getWidth() / Screen.getHeight();
  hasChangedProjection=true;
  Matrix4.createOrtho(orthogonalProjection,0,1,1,0,1,10);
  Matrix4.createLookAt(orthogonalModelView,0,0,1,0,0,0,0,1,0);
  Matrix4.multiply(orthogonalMVP,orthogonalProjection,orthogonalModelView);
  Log.e("String_Node_Str",orthogonalModelView.toString());
}
Program: 99125
Project: 99125
Buggy source:
private void drawTerrains(){
  ShaderProgram shaderProgram=Shader.DIFFUSE.getProgram(5);
  int program=shaderProgram.getProgramID();
  GLES20.glUseProgram(program);
  setLightUniform(program,lights);
  for (int i=0; i < terrains.size(); i++) {
    drawTerrain(program,terrains.get(i));
  }
}

Fixed version (ground truth):
private void drawTerrains(){
  ShaderProgram shaderProgram=Shader.DIFFUSE.getProgram(5);
  int program=shaderProgram.getProgramID();
  for (int i=0; i < terrains.size(); i++) {
    drawTerrain(program,terrains.get(i));
  }
}
Program: 99126
Project: 99126
Buggy source:
private static String[] getDiffuseSrc06(){
  String vs=matrixUniform + lightAttribute + vertexAttribute+ iDifVarying+ uvVarying+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ heightMap+ normalMap+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ initialUVCoordVarying+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ initialIDif+ lightLoop+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return new String[]{vs,fsWithTexture};
}

Fixed version (ground truth):
private static String[] getDiffuseSrc06(){
  String vs=matrixUniform + lightAttribute + iDifVarying+ uvVarying+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ heightMap+ normalMap+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ initialUVCoordVarying+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ initialIDif+ lightLoop+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  return new String[]{vs,fsWithTexture};
}
Program: 99127
Project: 99127
Buggy source:
public void onInitialize(){
  long start=System.nanoTime();
  model1=GameObjectManager.loadModel("String_Node_Str");
  model2=GameObjectManager.loadModel("String_Node_Str");
  float end=(System.nanoTime() - start) / 1000000f;
  log("String_Node_Str" + end + "String_Node_Str");
  skylight=new Light();
  skylight.setForward(0,-1,0);
  camera=Scene.getMainCamera();
  camera.setPosition(100,120,100);
  camera.setLookAt(new Vector3());
  camera.setProjectionType(Camera.PERSPECTIVE);
  camera.setRange(1000);
  addLayer(layer1);
  layer1.addChild(model1);
  layer1.addChild(model2);
  layer1.addChild(camera);
  layer1.addChild(skylight);
  model1.getAnimation().getAnimationClip("String_Node_Str").setPlaybackMode(PlaybackMode.LOOP);
  model1.getAnimation().getAnimationClip("String_Node_Str").setStart(35);
  model1.getAnimation().getAnimationClip("String_Node_Str").setEnd(50);
  model1.getAnimation().play("String_Node_Str");
  model2.setPosition(80,0,0);
  model2.getAnimation().getAnimationClip("String_Node_Str").setPlaybackMode(PlaybackMode.LOOP);
  model2.getAnimation().getAnimationClip("String_Node_Str").setEnd(200);
  model2.getAnimation().play("String_Node_Str");
  terrain=GameObjectManager.createTerrain("String_Node_Str",50,400);
  terrain.setBaseTexture(GameObjectManager.loadTexture2D("String_Node_Str"));
  layer1.addChild(terrain);
  view1=GameObjectManager.createImageView("String_Node_Str");
  layer2.addChild(view1);
}

Fixed version (ground truth):
public void onInitialize(){
  long start=System.nanoTime();
  model1=GameObjectManager.loadModel("String_Node_Str");
  model2=GameObjectManager.loadModel("String_Node_Str");
  float end=(System.nanoTime() - start) / 1000000f;
  log("String_Node_Str" + end + "String_Node_Str");
  skylight=new Light();
  skylight.setForward(0,-1,0);
  camera=Scene.getMainCamera();
  camera.setPosition(100,120,100);
  camera.setLookAt(new Vector3());
  camera.setProjectionType(Camera.PERSPECTIVE);
  camera.setRange(1000);
  addLayer(layer1);
  layer1.addChild(model1);
  layer1.addChild(model2);
  layer1.addChild(camera);
  layer1.addChild(skylight);
  model1.getAnimation().getAnimationClip("String_Node_Str").setPlaybackMode(PlaybackMode.LOOP);
  model1.getAnimation().getAnimationClip("String_Node_Str").setStart(35);
  model1.getAnimation().getAnimationClip("String_Node_Str").setEnd(50);
  model1.getAnimation().play("String_Node_Str");
  model2.setPosition(80,0,0);
  model2.getAnimation().getAnimationClip("String_Node_Str").setPlaybackMode(PlaybackMode.LOOP);
  model2.getAnimation().getAnimationClip("String_Node_Str").setEnd(200);
  model2.getAnimation().play("String_Node_Str");
  terrain=GameObjectManager.createTerrain("String_Node_Str",50,100);
  terrain.setBaseTexture(GameObjectManager.loadTexture2D("String_Node_Str"));
  layer1.addChild(terrain);
  view1=GameObjectManager.createImageView("String_Node_Str");
  layer2.addChild(view1);
}
Program: 99128
Project: 99128
Buggy source:
public ImageIcon loadIcon(){
  ImageIcon icon=null;
  try {
    int widgetType=-1;
    String stockId="String_Node_Str";
    int direction=1;
    String detail=null;
    int iconSize=com.sun.java.swing.plaf.gtk.GTKConstants.IconSize.SMALL_TOOLBAR.ordinal();
    UNIXToolkit utk=(UNIXToolkit)Toolkit.getDefaultToolkit();
    BufferedImage img=utk.getStockIcon(widgetType,stockId,iconSize,direction,detail);
    icon=new ImageIcon(img);
  }
 catch (  NoClassDefFoundError e) {
  }
catch (  Exception e) {
  }
 finally {
  }
  return icon;
}

Fixed version (ground truth):
public ImageIcon loadIcon(){
  ImageIcon icon=null;
  return icon;
}
Program: 99129
Project: 99129
Buggy source:
@Override public boolean hasFlag(char flag){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean hasFlag(char flag){
  return channelmodes.containsKey(flag);
}
Program: 99130
Project: 99130
Buggy source:
@Override public void removeFlag(char flag){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void removeFlag(char flag){
  channelmodes.remove(flag);
}
Program: 99131
Project: 99131
Buggy source:
@Override public String flags(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String flags(){
  return StringUtils.joinIterable(channelmodes.keySet(),"String_Node_Str");
}
Program: 99132
Project: 99132
Buggy source:
@Override public void addFlag(char flag){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void addFlag(char flag,String param){
  channelmodes.put(flag,param);
}
Program: 99133
Project: 99133
Buggy source:
/** 
 * Sets the given flag.
 * @param flag The flag to set
 */
public void addFlag(char flag);

Fixed version (ground truth):
/** 
 * Sets the given flag.
 * @param flag The flag to set
 */
public void addFlag(char flag,String params);
Program: 99134
Project: 99134
Buggy source:
private static void onPongCommand(Client client,String[] args){
  if (args.length == 0) {
    client.send(ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),PONG,"String_Node_Str"));
    return;
  }
  client.updatePing(args[0]);
}

Fixed version (ground truth):
private static void onPongCommand(Client client,String[] args){
  if (args.length == 0) {
    client.send(ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),PONG,"String_Node_Str"));
    return;
  }
  SharedData.logger.error("String_Node_Str" + Arrays.toString(args));
  client.updatePing(args[0]);
}
Program: 99135
Project: 99135
Buggy source:
private static void onOperCommand(Client client,String[] args){
  if (!client.registrationCompleted()) {
    return;
  }
  if (args.length < 2) {
    client.sendStandardFormat(Reply.ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),OPER,"String_Node_Str"));
    return;
  }
  if (!matchesOLine(client.getHostname())) {
    client.sendStandardFormat(Reply.ERR_NOOPERHOST.format(client.getSafeNickname()));
    return;
  }
  try {
    if (!checkOperPassword(args[0],args[1])) {
      client.sendStandardFormat(Reply.ERR_PASSWDMISMATCH.format(client.getSafeNickname()));
      return;
    }
  }
 catch (  NoSuchAlgorithmException ex) {
    SharedData.logger.error("String_Node_Str",ex);
    client.sendNotice(getFirstConfigOption(HOST),client.getSafeNickname(),"String_Node_Str");
    return;
  }
catch (  IncompleteConfigurationException ex) {
    client.sendNotice(getFirstConfigOption(HOST),client.getSafeNickname(),"String_Node_Str" + args[0]);
    return;
  }
  client.sendStandardFormat(Reply.RPL_YOUREOPER.format(client.getSafeNickname()));
  client.addFlag(Mode.UMODE_OPER);
}

Fixed version (ground truth):
private static void onOperCommand(Client client,String[] args){
  if (!client.registrationCompleted()) {
    return;
  }
  if (args.length < 2) {
    client.sendStandardFormat(Reply.ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),OPER,"String_Node_Str"));
    return;
  }
  if (!matchesOLine(client.getHostname())) {
    client.sendStandardFormat(Reply.ERR_NOOPERHOST.format(client.getSafeNickname()));
    return;
  }
  try {
    if (!checkOperPassword(args[0],args[1])) {
      client.sendStandardFormat(Reply.ERR_PASSWDMISMATCH.format(client.getSafeNickname()));
      return;
    }
  }
 catch (  NoSuchAlgorithmException ex) {
    SharedData.logger.error("String_Node_Str",ex);
    client.sendNotice(getFirstConfigOption(HOST),client.getSafeNickname(),"String_Node_Str");
    return;
  }
catch (  IncompleteConfigurationException ex) {
    client.sendNotice(getFirstConfigOption(HOST),client.getSafeNickname(),"String_Node_Str" + args[0]);
    return;
  }
  client.sendStandardFormat(Reply.RPL_YOUREOPER.format(client.getSafeNickname()));
  client.addFlag(Mode.UMODE_OPER,null);
}
Program: 99136
Project: 99136
Buggy source:
private static void onModeCommand(Client client,String[] args){
  if (!client.registrationCompleted()) {
    return;
  }
  if (args.length < 1 || args[0].length() < 1) {
    client.sendStandardFormat(Reply.ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),MODE,"String_Node_Str"));
    return;
  }
  Flagable target=client;
  if (SharedData.isChanTypeSupported(args[0].charAt(0))) {
    target=SharedData.getChannel(args[0]);
    if (target == null) {
      client.sendStandardFormat(ERR_NOSUCHCHANNEL.format(client.getNickname(),args[0]));
      return;
    }
  }
  if (args.length == 1) {
    Mode.handleModeChange(Mode.NO_FLAG,client,client,true,args,0);
    return;
  }
  boolean adding=true;
  int argIndex=2;
  for (  char c : args[1].toCharArray()) {
    if (c == '+') {
      adding=true;
    }
 else     if (c == '-') {
      adding=false;
    }
 else {
      argIndex=Mode.handleModeChange(c,client,client,adding,args,argIndex);
    }
  }
}

Fixed version (ground truth):
private static void onModeCommand(Client client,String[] args){
  if (!client.registrationCompleted()) {
    return;
  }
  if (args.length < 1 || args[0].length() < 1) {
    client.sendStandardFormat(Reply.ERR_NEEDMOREPARAMS.format(client.getSafeNickname(),MODE,"String_Node_Str"));
    return;
  }
  Flagable target=client;
  if (SharedData.isChanTypeSupported(args[0].charAt(0))) {
    target=SharedData.getChannel(args[0]);
    if (target == null) {
      client.sendStandardFormat(ERR_NOSUCHCHANNEL.format(client.getNickname(),args[0]));
      return;
    }
  }
  if (args.length == 1) {
    Mode.handleModeChange(Mode.NO_FLAG,client,target,true,args,0);
    return;
  }
  boolean adding=true;
  int argIndex=2;
  for (  char c : args[1].toCharArray()) {
    if (c == '+') {
      adding=true;
    }
 else     if (c == '-') {
      adding=false;
    }
 else {
      argIndex=Mode.handleModeChange(c,client,client,adding,args,argIndex);
    }
  }
}
Program: 99137
Project: 99137
Buggy source:
private static void processUmodeInvisible(Flagable target,boolean adding){
  if (adding) {
    target.addFlag(UMODE_INVISIBLE);
  }
 else {
    target.removeFlag(UMODE_INVISIBLE);
  }
}

Fixed version (ground truth):
private static void processUmodeInvisible(Flagable target,boolean adding){
  if (adding) {
    target.addFlag(UMODE_INVISIBLE,null);
  }
 else {
    target.removeFlag(UMODE_INVISIBLE);
  }
}
Program: 99138
Project: 99138
Buggy source:
public static int handleModeChange(char mode,Client user,Flagable target,boolean adding,String[] args,int argIndex){
  if (target instanceof Client) {
    if (user != target && (!user.hasFlag(UMODE_OPER) || !SharedData.operCanSetModes)) {
      user.sendStandardFormat(Reply.ERR_USERSDONTMATCH.format(user.getNickname()));
      return argIndex;
    }
    if (mode == UMODE_OPER)     processUmodeOper(user,target,adding);
 else     if (mode == UMODE_INVISIBLE)     processUmodeInvisible(target,adding);
 else     if (mode == UMODE_REGISTERED)     processUmodeRegistered(user,target,adding);
 else     if (mode == NO_FLAG)     user.sendStandardFormat(Reply.RPL_UMODEIS.format(user.getNickname(),user.flags()));
 else {
      user.sendStandardFormat(Reply.ERR_UMODEUNKNOWNFLAG.format(user.getNickname(),mode));
    }
  }
 else   if (target instanceof Channel) {
    Channel chan=(Channel)target;
    if (!user.isInChannel(chan.getName()) && (!user.hasFlag(UMODE_OPER) || !SharedData.operCanSetModes)) {
      user.sendStandardFormat(Reply.ERR_NOTONCHANNEL.format(user.getNickname(),chan.getName()));
      return argIndex;
    }
  }
 else {
    SharedData.logger.error("String_Node_Str" + target + "String_Node_Str");
    for (    StackTraceElement trace : Thread.currentThread().getStackTrace()) {
      SharedData.logger.error(trace.toString());
    }
  }
  return argIndex;
}

Fixed version (ground truth):
public static int handleModeChange(char mode,Client user,Flagable target,boolean adding,String[] args,int argIndex){
  if (target instanceof Client) {
    if (user != target && (!user.hasFlag(UMODE_OPER) || !SharedData.operCanSetModes)) {
      user.sendStandardFormat(Reply.ERR_USERSDONTMATCH.format(user.getNickname()));
      return argIndex;
    }
    if (mode == UMODE_OPER)     processUmodeOper(user,target,adding);
 else     if (mode == UMODE_INVISIBLE)     processUmodeInvisible(target,adding);
 else     if (mode == UMODE_REGISTERED)     processUmodeRegistered(user,target,adding);
 else     if (mode == NO_FLAG)     user.sendStandardFormat(Reply.RPL_UMODEIS.format(user.getNickname(),user.flags()));
 else {
      user.sendStandardFormat(Reply.ERR_UMODEUNKNOWNFLAG.format(user.getNickname(),mode));
    }
  }
 else   if (target instanceof Channel) {
    Channel chan=(Channel)target;
    if (!user.isInChannel(chan.getName()) && (!user.hasFlag(UMODE_OPER) || !SharedData.operCanSetModes)) {
      user.sendStandardFormat(Reply.ERR_NOTONCHANNEL.format(user.getNickname(),chan.getName()));
      return argIndex;
    }
    if (mode == NO_FLAG)     user.sendStandardFormat(Reply.RPL_CHANNELMODEIS.format(user.getNickname(),chan.getName(),chan.flags(),chan.flagParams()));
  }
 else {
    SharedData.logger.error("String_Node_Str" + target + "String_Node_Str");
    for (    StackTraceElement trace : Thread.currentThread().getStackTrace()) {
      SharedData.logger.error(trace.toString());
    }
  }
  return argIndex;
}
Program: 99139
Project: 99139
Buggy source:
public String flags(){
  StringBuilder builder=new StringBuilder();
  for (  Character character : flags) {
    builder.append(character);
  }
  return builder.toString();
}

Fixed version (ground truth):
public String flags(){
  return StringUtils.joinIterable(flags.keySet(),"String_Node_Str");
}
Program: 99140
Project: 99140
Buggy source:
public boolean hasFlag(char flag){
  return flags.contains(flag);
}

Fixed version (ground truth):
public boolean hasFlag(char flag){
  return flags.containsKey(flag);
}
Program: 99141
Project: 99141
Buggy source:
@Override public void onInput(String input){
  SharedData.logger.trace(String.format("String_Node_Str",this,input));
  String[] fields=input.split("String_Node_Str",2);
  String[] toLastArg=(fields.length > 1) ? fields[1].split("String_Node_Str") : new String[0];
  String[] otherArgs=(toLastArg.length > 0) ? toLastArg[0].trim().split("String_Node_Str") : new String[0];
  String[] argsTotal=new String[otherArgs.length + ((toLastArg.length > 1) ? 1 : 0)];
  System.arraycopy(otherArgs,0,argsTotal,0,otherArgs.length);
  if (toLastArg.length > 1) {
    argsTotal[argsTotal.length - 1]=toLastArg[1];
  }
  SharedData.onClientCommand(this,fields[0],argsTotal);
}

Fixed version (ground truth):
@Override public void onInput(String input){
  SharedData.logger.debug(String.format("String_Node_Str" + this + "String_Node_Str"+ input));
  String[] fields=input.split("String_Node_Str",2);
  String[] args;
  if (fields.length >= 2 && fields[1].trim().startsWith("String_Node_Str")) {
    args=new String[]{fields[1].trim().substring(1)};
  }
 else {
    String[] toLastArg=(fields.length > 1) ? fields[1].split("String_Node_Str") : new String[0];
    String[] otherArgs=(toLastArg.length > 0) ? toLastArg[0].trim().split("String_Node_Str") : new String[0];
    args=new String[otherArgs.length + ((toLastArg.length > 1) ? 1 : 0)];
    System.arraycopy(otherArgs,0,args,0,otherArgs.length);
    if (toLastArg.length > 1) {
      args[args.length - 1]=toLastArg[1];
    }
  }
  SharedData.onClientCommand(this,fields[0],args);
}
Program: 99142
Project: 99142
Buggy source:
public void addFlag(char flag){
  flags.add(flag);
  onModeChange();
}

Fixed version (ground truth):
public void addFlag(char flag,String mode){
  flags.put(flag,mode);
  onModeChange();
}
Program: 99143
Project: 99143
Buggy source:
public void onRegistrationComplete(){
  welcomeSent=true;
  addFlag(Mode.UMODE_INVISIBLE);
  sendStandardFormat(Reply.RPL_WELCOME.format(nickname,getHostmask()));
  sendStandardFormat(Reply.RPL_YOURHOST.format(nickname));
  sendStandardFormat(Reply.RPL_CREATED.format(nickname));
  sendStandardFormat(Reply.RPL_MYINFO.format(nickname));
  sendStandardFormat(Reply.RPL_ISUPPORT.format(nickname));
  sendStandardFormat(Reply.RPL_MOTDSTART.format(nickname));
  if (SharedData.motd != null) {
    for (    String part : SharedData.motd.split("String_Node_Str")) {
      sendStandardFormat(Reply.RPL_MOTD.format(nickname,part));
    }
  }
  sendStandardFormat(Reply.RPL_ENDOFMOTD.format(nickname));
}

Fixed version (ground truth):
public void onRegistrationComplete(){
  welcomeSent=true;
  addFlag(Mode.UMODE_INVISIBLE,null);
  sendStandardFormat(Reply.RPL_WELCOME.format(nickname,getHostmask()));
  sendStandardFormat(Reply.RPL_YOURHOST.format(nickname));
  sendStandardFormat(Reply.RPL_CREATED.format(nickname));
  sendStandardFormat(Reply.RPL_MYINFO.format(nickname));
  sendStandardFormat(Reply.RPL_ISUPPORT.format(nickname));
  sendStandardFormat(Reply.RPL_MOTDSTART.format(nickname));
  if (SharedData.motd != null) {
    for (    String part : SharedData.motd.split("String_Node_Str")) {
      sendStandardFormat(Reply.RPL_MOTD.format(nickname,part));
    }
  }
  sendStandardFormat(Reply.RPL_ENDOFMOTD.format(nickname));
}
Program: 99144
Project: 99144
Buggy source:
/** 
 * Sends a message to the client
 * @param line The message to send
 */
public void send(String line){
  try {
    SharedData.logger.trace(String.format("String_Node_Str",socket.getInetAddress(),line));
    writer.write(String.format("String_Node_Str",line));
    writer.flush();
  }
 catch (  IOException ioe) {
    if (closed) {
      return;
    }
    SharedData.logger.error(String.format("String_Node_Str",socket.getInetAddress()),ioe);
    disconnect(ioe.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Sends a message to the client
 * @param line The message to send
 */
public void send(String line){
  try {
    SharedData.logger.debug("String_Node_Str" + this + "String_Node_Str"+ line);
    writer.write(String.format("String_Node_Str",line));
    writer.flush();
  }
 catch (  IOException ioe) {
    if (closed) {
      return;
    }
    SharedData.logger.error(String.format("String_Node_Str",socket.getInetAddress()),ioe);
    disconnect(ioe.getMessage());
  }
}
Program: 99145
Project: 99145
Buggy source:
public Universe toUniverse(){
  System.out.println(Arrays.toString(universe.board));
  return universe;
}

Fixed version (ground truth):
public Universe toUniverse(){
  Universe universe=new Universe(rows,cols,board);
  System.out.println(Arrays.toString(universe.board));
  return universe;
}
Program: 99147
Project: 99147
Buggy source:
private void setDeadUntilNewline(){
  while (xFillCounter < universe.cols) {
    universe.board[xFillCounter][yFillCounter]=0;
    xFillCounter++;
  }
  yFillCounter++;
}

Fixed version (ground truth):
private void setDeadUntilNewline(){
  while (xFillCounter < cols) {
    board[yFillCounter][xFillCounter]=0;
    xFillCounter++;
  }
  xFillCounter=0;
  yFillCounter++;
}
Program: 99148
Project: 99148
Buggy source:
private void setCell(boolean state){
  int mark;
  if (state)   mark=1;
 else   mark=0;
  universe.board[xFillCounter][yFillCounter]=mark;
  xFillCounter++;
  if (xFillCounter >= universe.cols) {
    xFillCounter=0;
    yFillCounter++;
  }
}

Fixed version (ground truth):
private void setCell(boolean state){
  int mark;
  if (state)   mark=1;
 else   mark=0;
  board[yFillCounter][xFillCounter]=mark;
  xFillCounter++;
}
Program: 99149
Project: 99149
Buggy source:
public RaySpace(Universe u){
  universe=u;
  tiles=new SpaceTile[u.rows][u.cols];
  for (int i=0; i < u.rows; i++) {
    for (int j=0; j < u.cols; j++) {
      SpaceVector p0=planeMapping(i,j);
      SpaceVector pA=planeMapping(i,j);
      SpaceVector pB=planeMapping(i,j);
      tiles[i][j]=new SpaceTile(p0,pA,pB);
    }
  }
}

Fixed version (ground truth):
public RaySpace(Universe u){
  universe=u;
  tiles=new SpaceTile[u.rows][u.cols];
  for (int i=0; i < u.rows; i++) {
    for (int j=0; j < u.cols; j++) {
      SpaceVector p0=planeMapping(i,j);
      SpaceVector pA=planeMapping(i + 1,j);
      SpaceVector pB=planeMapping(i,j + 1);
      tiles[i][j]=new SpaceTile(p0,pA,pB);
    }
  }
}
Program: 99150
Project: 99150
Buggy source:
public RayPixel castRay(SpaceVector cameraAt,SpaceVector cameraDir){
  float closest_t=Float.POSITIVE_INFINITY;
  RayPixel hit=new RayPixel();
  float t;
  boolean inside;
  for (int i=0; i < universe.rows; i++) {
    for (int j=0; j < universe.rows; j++) {
      t=intersection_t(cameraAt,cameraDir,tiles[i][j]);
      System.out.println(t + "String_Node_Str" + i+ "String_Node_Str"+ j);
      if (t < 0)       break;
 else       if (t > closest_t)       break;
      inside=inTile(cameraAt.plus(cameraDir.scale(t)),tiles[i][j]);
      if (!inside)       break;
 else {
        closest_t=t;
        hit=new RayPixel(i,j);
      }
    }
  }
  return hit;
}

Fixed version (ground truth):
public RayPixel castRay(SpaceVector cameraAt,SpaceVector cameraDir){
  float closest_t=Float.POSITIVE_INFINITY;
  RayPixel hit=new RayPixel();
  float t;
  boolean inside;
  for (int i=0; i < universe.rows; i++) {
    for (int j=0; j < universe.cols; j++) {
      System.out.println(j);
      t=intersection_t(cameraAt,cameraDir,tiles[i][j]);
      System.out.println(j);
      System.out.println(t + "String_Node_Str" + i+ "String_Node_Str"+ j);
      if (t < 0)       break;
 else       if (t > closest_t)       break;
      inside=inTile(cameraAt.plus(cameraDir.scale(t)),tiles[i][j]);
      if (!inside)       break;
 else {
        closest_t=t;
        hit=new RayPixel(i,j);
      }
    }
  }
  return hit;
}
Program: 99151
Project: 99151
Buggy source:
public String perform(HttpServletRequest request){
  List<String> errors=new ArrayList<String>();
  request.setAttribute("String_Node_Str",errors);
  HttpSession session=request.getSession();
  User curUser=(User)session.getAttribute("String_Node_Str");
  if (curUser == null) {
    return "String_Node_Str";
  }
  try {
    int routeID;
    FavRouteForm form=formBeanFactory.create(request);
    errors.addAll(form.getValidationErrors());
    if (errors.size() != 0) {
      return "String_Node_Str";
    }
    routeID=Integer.parseInt(form.getRouteID());
    if (form.getAction().equals("String_Node_Str")) {
      favRouteDAO.delete(routeID);
    }
 else {
      FavRoute fav=new FavRoute();
      fav.setBid(routeID);
      fav.setUid(curUser.getId());
      if (favRouteDAO.hasFav(fav.getUid(),fav.getBid())) {
        errors.add("String_Node_Str");
        return "String_Node_Str";
      }
      favRouteDAO.createAutoIncrement(fav);
    }
    return "String_Node_Str";
  }
 catch (  RollbackException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
catch (  NumberFormatException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
catch (  FormBeanException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public String perform(HttpServletRequest request){
  List<String> errors=new ArrayList<String>();
  request.setAttribute("String_Node_Str",errors);
  HttpSession session=request.getSession();
  User curUser=(User)session.getAttribute("String_Node_Str");
  if (curUser == null) {
    return "String_Node_Str";
  }
  try {
    int routeID;
    FavRouteForm form=formBeanFactory.create(request);
    errors.addAll(form.getValidationErrors());
    if (errors.size() != 0) {
      return "String_Node_Str";
    }
    routeID=Integer.parseInt(form.getRouteID());
    if (form.getAction().equals("String_Node_Str")) {
      if (favRouteDAO.deleteByPair(curUser.getId(),routeID) == false) {
        errors.add("String_Node_Str");
        return "String_Node_Str";
      }
    }
 else {
      FavRoute fav=new FavRoute();
      fav.setBid(routeID);
      fav.setUid(curUser.getId());
      if (favRouteDAO.hasFav(fav.getUid(),fav.getBid())) {
        errors.add("String_Node_Str");
        return "String_Node_Str";
      }
      favRouteDAO.createAutoIncrement(fav);
    }
    return "String_Node_Str";
  }
 catch (  RollbackException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
catch (  NumberFormatException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
catch (  FormBeanException e) {
    errors.add(e.getMessage());
    return "String_Node_Str";
  }
}
Program: 99153
Project: 99153
Buggy source:
public List<String> getValidationErrors(){
  List<String> errors=new ArrayList<String>();
  if (action == null) {
    errors.add("String_Node_Str");
    return errors;
  }
  if (!action.equals("String_Node_Str") && !action.equals("String_Node_Str") && !action.equals("String_Node_Str")) {
    errors.add("String_Node_Str");
    return errors;
  }
  if (action.equals("String_Node_Str") || action.equals("String_Node_Str")) {
    if (reportID == null || reportID.length() == 0) {
      errors.add("String_Node_Str");
      return errors;
    }
    if (reportID.matches("String_Node_Str")) {
      errors.add("String_Node_Str");
    }
    if (!checkInt(reportID,errors)) {
      return errors;
    }
  }
 else {
    if (routeID == null || routeID.length() == 0) {
      errors.add("String_Node_Str");
      return errors;
    }
    if (!checkInt(routeID,errors)) {
      return errors;
    }
    if (!checkCoordinate(geolong,errors)) {
      return errors;
    }
    if (!checkCoordinate(geolat,errors)) {
      return errors;
    }
    if (!checkCoordinate(geoaccu,errors)) {
      return errors;
    }
    if (Float.parseFloat(geoaccu) > MAX_ACCU) {
      errors.add("String_Node_Str" + MAX_ACCU + "String_Node_Str");
      return errors;
    }
    if (comment != null && comment.matches("String_Node_Str")) {
      errors.add("String_Node_Str");
    }
  }
  return errors;
}

Fixed version (ground truth):
public List<String> getValidationErrors(){
  List<String> errors=new ArrayList<String>();
  if (action == null) {
    errors.add("String_Node_Str");
    return errors;
  }
  if (!action.equals("String_Node_Str") && !action.equals("String_Node_Str") && !action.equals("String_Node_Str")) {
    errors.add("String_Node_Str");
    return errors;
  }
  if (action.equals("String_Node_Str") || action.equals("String_Node_Str")) {
    if (reportID == null || reportID.length() == 0) {
      errors.add("String_Node_Str");
      return errors;
    }
    if (reportID.matches("String_Node_Str")) {
      errors.add("String_Node_Str");
    }
    if (!checkInt(reportID,errors)) {
      return errors;
    }
  }
 else {
    if (routeID == null || routeID.length() == 0) {
      errors.add("String_Node_Str");
      return errors;
    }
    if (!checkInt(routeID,errors)) {
      return errors;
    }
    if (!checkCoordinate(geolong,errors)) {
      return errors;
    }
    if (!checkCoordinate(geolat,errors)) {
      return errors;
    }
    if (!checkCoordinate(geoaccu,errors)) {
      return errors;
    }
    if (Float.parseFloat(geoaccu) > MAX_ACCU) {
      errors.add("String_Node_Str" + MAX_ACCU + "String_Node_Str");
      return errors;
    }
    if (comment != null && comment.matches("String_Node_Str")) {
      errors.add("String_Node_Str");
      return errors;
    }
    if (comment.length() > 140) {
      errors.add("String_Node_Str");
      return errors;
    }
  }
  return errors;
}
Program: 99154
Project: 99154
Buggy source:
public void showDialog(){
  setLocationRelativeTo(MainWindow.getMainWindow());
  setVisible(true);
}

Fixed version (ground truth):
public void showDialog(){
  pack();
  setLocationRelativeTo(MainWindow.getMainWindow());
  setVisible(true);
}
Program: 99155
Project: 99155
Buggy source:
public void onGameStageChanged(GameState gameState){
  if (gameState == GameState.FINISHED) {
    roundManager.setRound(roundManager.getRound() + 1);
  }
}

Fixed version (ground truth):
public void onGameStageChanged(GameState gameState){
  if (isFinishedOnce && gameState == GameState.WAIT_START_TIMER)   roundManager.setRound(roundManager.getRound() + 1);
 else   if (gameState == GameState.FINISHED)   isFinishedOnce=true;
}
Program: 99156
Project: 99156
Buggy source:
public void noOneAnswered(){
  answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
  gameStateManager.setGameState(GameState.FINISHED);
  priceManager.setPrice(priceManager.getPrice() + 1);
}

Fixed version (ground truth):
public void noOneAnswered(){
  answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
  priceManager.setPrice(priceManager.getPrice() + 1);
  gameStateManager.setGameState(GameState.FINISHED);
}
Program: 99157
Project: 99157
Buggy source:
private MaxRoundController(){
  roundManager.addListener(this);
}

Fixed version (ground truth):
private MaxRoundController(){
  gameStateManager.addListener(this);
}
Program: 99158
Project: 99158
Buggy source:
public void setFalseStart(){
  answerStateManager.setAnswerState(AnswerState.ONE_ANSWERED);
  gameStateManager.setGameState(GameState.RUNNING);
}

Fixed version (ground truth):
public void setFalseStart(){
  answerStateManager.setAnswerState(AnswerState.ONE_ANSWERED);
}
Program: 99159
Project: 99159
Buggy source:
public void answer(boolean isCorrect){
  if (isCorrect) {
switch (answerSideManager.getAnswerSide()) {
case LEFT:
      scoreManager.increaseLeftScore(priceManager.getPrice());
    break;
case RIGHT:
  scoreManager.increaseRightScore(priceManager.getPrice());
break;
}
priceManager.setPrice(1);
answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
gameStateManager.setGameState(GameState.FINISHED);
setChanged();
notifyObservers();
}
 else {
switch (answerStateManager.getAnswerState()) {
case NOBODY_ANSWERED:
answerStateManager.setAnswerState(AnswerState.ONE_ANSWERED);
gameStateManager.setGameState(GameState.RUNNING);
break;
case ONE_ANSWERED:
noOneAnswered();
break;
}
}
}

Fixed version (ground truth):
public void answer(boolean isCorrect){
  if (isCorrect) {
switch (answerSideManager.getAnswerSide()) {
case LEFT:
      scoreManager.increaseLeftScore(priceManager.getPrice());
    break;
case RIGHT:
  scoreManager.increaseRightScore(priceManager.getPrice());
break;
}
priceManager.setPrice(1);
answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
setChanged();
notifyObservers();
}
 else {
switch (answerStateManager.getAnswerState()) {
case NOBODY_ANSWERED:
answerStateManager.setAnswerState(AnswerState.ONE_ANSWERED);
break;
case ONE_ANSWERED:
noOneAnswered();
break;
}
}
}
Program: 99160
Project: 99160
Buggy source:
public void noOneAnswered(){
  answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
  priceManager.setPrice(priceManager.getPrice() + 1);
  gameStateManager.setGameState(GameState.FINISHED);
}

Fixed version (ground truth):
public void noOneAnswered(){
  answerStateManager.setAnswerState(AnswerState.NOBODY_ANSWERED);
  priceManager.setPrice(priceManager.getPrice() + 1);
}
Program: 99161
Project: 99161
Buggy source:
public void actionPerformed(ActionEvent e){
  int time=timeManager.getTime();
  timeManager.setTime(time + TIMER_DELAY);
  if (!warnPlayed && time > WARN_TIME) {
    soundManager.playWarnSound();
    warnPlayed=true;
  }
  if (time > OVER_TIME) {
    soundManager.playOverSound();
    gameStateManager.setGameState(GameState.FINISHED);
    timeManager.setTime(OVER_TIME);
    scoreManager.noOneAnswered();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  int time=timeManager.getTime();
  timeManager.setTime(time + TIMER_DELAY);
  if (!warnPlayed && time > WARN_TIME) {
    soundManager.playWarnSound();
    warnPlayed=true;
  }
  if (time > OVER_TIME) {
    soundManager.playOverSound();
    StateManager.getInstance().setState(new EndRound());
    Timer.getInstance().stop();
    timeManager.setTime(OVER_TIME);
  }
}
Program: 99162
Project: 99162
Buggy source:
public Timer(){
  timer=new javax.swing.Timer(TIMER_DELAY,new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int time=timeManager.getTime();
      timeManager.setTime(time + TIMER_DELAY);
      if (!warnPlayed && time > WARN_TIME) {
        soundManager.playWarnSound();
        warnPlayed=true;
      }
      if (time > OVER_TIME) {
        soundManager.playOverSound();
        gameStateManager.setGameState(GameState.FINISHED);
        timeManager.setTime(OVER_TIME);
        scoreManager.noOneAnswered();
      }
    }
  }
);
}

Fixed version (ground truth):
public Timer(){
  timer=new javax.swing.Timer(TIMER_DELAY,new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int time=timeManager.getTime();
      timeManager.setTime(time + TIMER_DELAY);
      if (!warnPlayed && time > WARN_TIME) {
        soundManager.playWarnSound();
        warnPlayed=true;
      }
      if (time > OVER_TIME) {
        soundManager.playOverSound();
        StateManager.getInstance().setState(new EndRound());
        Timer.getInstance().stop();
        timeManager.setTime(OVER_TIME);
      }
    }
  }
);
}
Program: 99163
Project: 99163
Buggy source:
public BrainPanelTest() throws HeadlessException {
  super();
  new Initializer();
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  JLayeredPane layeredPane=new JLayeredPane();
  setLayeredPane(layeredPane);
  final BrainPanel brainPanel=new BrainPanel(this);
  layeredPane.add(brainPanel,JLayeredPane.DEFAULT_LAYER);
  layeredPane.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      Component component=e.getComponent();
      brainPanel.setSize(component.getSize());
      brainPanel.validate();
    }
  }
);
  pack();
  Point centerPoint=GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
  setLocation(centerPoint.x - getWidth() / 2,centerPoint.y - getHeight() / 2);
  setVisible(true);
  setSize(800,600);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyboardDispatcher());
  Toolkit.getDefaultToolkit().addAWTEventListener(new org.i4qwee.chgk.trainer.new_brain.actionlisteners.MouseListener(),AWTEvent.MOUSE_EVENT_MASK);
}

Fixed version (ground truth):
public BrainPanelTest() throws HeadlessException {
  super();
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  JLayeredPane layeredPane=new JLayeredPane();
  setLayeredPane(layeredPane);
  final BrainPanel brainPanel=new BrainPanel(this);
  layeredPane.add(brainPanel,JLayeredPane.DEFAULT_LAYER);
  layeredPane.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      Component component=e.getComponent();
      brainPanel.setSize(component.getSize());
      brainPanel.validate();
    }
  }
);
  pack();
  Point centerPoint=GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
  setLocation(centerPoint.x - getWidth() / 2,centerPoint.y - getHeight() / 2);
  setVisible(true);
  setSize(800,600);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyboardDispatcher());
  Toolkit.getDefaultToolkit().addAWTEventListener(new org.i4qwee.chgk.trainer.new_brain.actionlisteners.MouseListener(),AWTEvent.MOUSE_EVENT_MASK);
}
Program: 99164
Project: 99164
Buggy source:
public void onRoundChanged(int round,int maxRound){
  if (round > maxRound) {
    String leftName=namesManager.getLeftName();
    if (leftName == null || leftName.equals("String_Node_Str"))     leftName="String_Node_Str";
    String rightName=namesManager.getRightName();
    if (rightName == null || rightName.equals("String_Node_Str"))     rightName="String_Node_Str";
    if (scoreManager.getLeftScore() > scoreManager.getRightScore())     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),leftName + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
 else     if (scoreManager.getLeftScore() < scoreManager.getRightScore())     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),rightName + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
 else     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
    ScoreManagerSingleton.getInstance().newGame();
  }
}

Fixed version (ground truth):
public void onRoundChanged(int round,int maxRound){
  if (maxRound != 0 && round > maxRound) {
    String leftName=namesManager.getLeftName();
    if (leftName == null || leftName.equals("String_Node_Str"))     leftName="String_Node_Str";
    String rightName=namesManager.getRightName();
    if (rightName == null || rightName.equals("String_Node_Str"))     rightName="String_Node_Str";
    if (scoreManager.getLeftScore() > scoreManager.getRightScore())     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),leftName + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
 else     if (scoreManager.getLeftScore() < scoreManager.getRightScore())     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),rightName + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
 else     JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE);
    ScoreManagerSingleton.getInstance().newGame();
  }
}