nus-yam/ex-repair huggingface dataset:
Program: 7610
Project: 7610
Buggy source:
public DownloadInfo(Context context,SystemFacade systemFacade,Cursor cursor){
  mContext=context;
  mSystemFacade=systemFacade;
  int retryRedirect=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.RETRY_AFTER_X_REDIRECT_COUNT));
  mId=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl._ID));
  mUri=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_URI));
  mNoIntegrity=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NO_INTEGRITY)) == 1;
  mHint=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_FILE_NAME_HINT));
  mFileName=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl._DATA));
  mMimeType=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_MIME_TYPE));
  mDestination=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_DESTINATION));
  mVisibility=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_VISIBILITY));
  mControl=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CONTROL));
  mStatus=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_STATUS));
  mNumFailed=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.FAILED_CONNECTIONS));
  mRetryAfter=retryRedirect & 0xfffffff;
  mRedirectCount=retryRedirect >> 28;
  mLastMod=cursor.getLong(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_LAST_MODIFICATION));
  mPackage=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NOTIFICATION_PACKAGE));
  mClass=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NOTIFICATION_CLASS));
  mExtras=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_NOTIFICATION_EXTRAS));
  mCookies=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_COOKIE_DATA));
  mUserAgent=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_USER_AGENT));
  mReferer=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_REFERER));
  mTotalBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_TOTAL_BYTES));
  mCurrentBytes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_CURRENT_BYTES));
  mETag=cursor.getString(cursor.getColumnIndexOrThrow(Constants.ETAG));
  mMediaScanned=cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) == 1;
  mIsPublicApi=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_IS_PUBLIC_API)) != 0;
  mAllowedNetworkTypes=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_ALLOWED_NETWORK_TYPES));
  mAllowRoaming=cursor.getInt(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_ALLOW_ROAMING)) != 0;
  mTitle=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_TITLE));
  mDescription=cursor.getString(cursor.getColumnIndexOrThrow(Downloads.Impl.COLUMN_DESCRIPTION));
  mFuzz=Helpers.sRandom.nextInt(1001);
  readRequestHeaders(mId);
}

Fixed version (ground truth):
private DownloadInfo(Context context,SystemFacade systemFacade){
  mContext=context;
  mSystemFacade=systemFacade;
  mFuzz=Helpers.sRandom.nextInt(1001);
}
Program: 7612
Project: 7612
Buggy source:
public void updateNotification(List<DownloadInfo> downloads){
  updateActiveNotification(downloads);
  updateCompletedNotification(downloads);
}

Fixed version (ground truth):
public void updateNotification(Collection<DownloadInfo> downloads){
  updateActiveNotification(downloads);
  updateCompletedNotification(downloads);
}
Program: 7616
Project: 7616
Buggy source:
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_FILE,escapedVideoFileName);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}

Fixed version (ground truth):
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,BackupTubeCommon.escapeReplaceAllText(clientType));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,BackupTubeCommon.escapeReplaceAllText(clientVersion));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.escapeReplaceAllText(BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime())));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_TITLE,BackupTubeCommon.escapeReplaceAllText(getTitle() + "String_Node_Str" + getUploader()));
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_FILE,BackupTubeCommon.escapeReplaceAllText(escapedVideoFileName));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,BackupTubeCommon.escapeReplaceAllText(getTitle()));
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}
Program: 7617
Project: 7617
Buggy source:
public YouTubeVideo getResponseVideo(){
  return responseVideo;
}

Fixed version (ground truth):
public YouTubeVideo getResponseVideo(){
  findResponseInfo();
  return responseVideo;
}
Program: 7618
Project: 7618
Buggy source:
private void findResponseInfo(){
  if (!hasFoundResponseInfo() && source.indexOf("String_Node_Str") > (-1)) {
    try {
      String vid=BackupHelper.between(source,"String_Node_Str","String_Node_Str");
      System.err.println("String_Node_Str" + vid);
      URL videoURL=new URL("String_Node_Str" + URLEncoder.encode(vid,"String_Node_Str") + "String_Node_Str");
      URLConnection connection=videoURL.openConnection();
      YouTubeVideoWithEntry videoEntry=new Gson().fromJson(new InputStreamReader(connection.getInputStream()),YouTubeVideoWithEntry.class);
      responseVideo=videoEntry.getVideo();
      responseVideo.init();
    }
 catch (    Exception ex) {
    }
  }
  hasFoundResponseInfo=true;
}

Fixed version (ground truth):
private void findResponseInfo(){
  if (!hasFoundResponseInfo() && source.indexOf("String_Node_Str") > (-1)) {
    try {
      String vid=BackupHelper.between(source,"String_Node_Str","String_Node_Str");
      URL videoURL=new URL("String_Node_Str" + URLEncoder.encode(vid,"String_Node_Str") + "String_Node_Str");
      URLConnection connection=videoURL.openConnection();
      YouTubeVideoWithEntry videoEntry=new Gson().fromJson(new InputStreamReader(connection.getInputStream()),YouTubeVideoWithEntry.class);
      responseVideo=videoEntry.getVideo();
      responseVideo.init();
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
  }
  hasFoundResponseInfo=true;
}
Program: 7619
Project: 7619
Buggy source:
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replace(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replace(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_FILE,escapedVideoFileName);
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}

Fixed version (ground truth):
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replace(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replace(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_FILE,escapedVideoFileName);
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replace(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}
Program: 7620
Project: 7620
Buggy source:
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,BackupTubeCommon.escapeReplaceAllText(clientType));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,BackupTubeCommon.escapeReplaceAllText(clientVersion));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.escapeReplaceAllText(BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime())));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_TITLE,BackupTubeCommon.escapeReplaceAllText(getTitle() + "String_Node_Str" + getUploader()));
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_FILE,BackupTubeCommon.escapeReplaceAllText(escapedVideoFileName));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,BackupTubeCommon.escapeReplaceAllText(getTitle()));
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}

Fixed version (ground truth):
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replace(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replace(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replace(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_FILE,escapedVideoFileName);
  html=html.replace(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}
Program: 7621
Project: 7621
Buggy source:
@Override public void initInfoTable(){
  setInfoTableTitle("String_Node_Str");
  addInfoTableEntry("String_Node_Str","String_Node_Str" + getUrl() + "String_Node_Str");
  addInfoTableEntry("String_Node_Str",getUploader());
  addInfoTableEntry("String_Node_Str",getPublishedOn());
  addInfoTableEntry("String_Node_Str",getDownloadedOn());
  addInfoTableEntry("String_Node_Str",getDescription());
}

Fixed version (ground truth):
@Override public void initInfoTable(){
  setInfoTableTitle("String_Node_Str");
  addInfoTableEntry("String_Node_Str","String_Node_Str" + BackupTubeCommon.escapeURL(getUrl()) + "String_Node_Str");
  addInfoTableEntry("String_Node_Str",getUploader());
  addInfoTableEntry("String_Node_Str",getPublishedOn());
  addInfoTableEntry("String_Node_Str",getDownloadedOn());
  addInfoTableEntry("String_Node_Str",getDescription());
}
Program: 7622
Project: 7622
Buggy source:
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_FILE,videoFileName);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}

Fixed version (ground truth):
public void saveHTML(File file,String videoFileName,String clientType,String clientVersion) throws FileNotFoundException {
  String html=BackupTubeCommon.getHTMLTemplate();
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_TYPE,clientType);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_CLIENT_VERSION,clientVersion);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_GEN_DATE,BackupTubeCommon.getTimeString(BackupTubeCommon.getCurrentTime()));
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_TITLE,getTitle() + "String_Node_Str" + getUploader());
  String escapedVideoFileName=videoFileName.replaceAll("String_Node_Str","String_Node_Str");
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_FILE,escapedVideoFileName);
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_VIDEO_TITLE,getTitle());
  String info="String_Node_Str";
  LinkedList<VideoInfoModule> infoModules=new LinkedList();
  infoModules.add(this);
  for (  VideoInfoModule module : getExtraModules()) {
    infoModules.add(module);
  }
  infoModules.add(getSiteInfo());
  for (  VideoInfoModule moduleToShow : infoModules) {
    info+=moduleToShow.getHTML() + "String_Node_Str";
  }
  html=html.replaceAll(BackupTubeCommon.TEMPLATE_INFO,info);
  PrintWriter writer=new PrintWriter(file);
  writer.write(html);
  writer.close();
}
Program: 7623
Project: 7623
Buggy source:
@Override public void initInfoTable(){
  setInfoTableTitle("String_Node_Str");
  addInfoTableEntry("String_Node_Str","String_Node_Str" + getUrl() + "String_Node_Str"+ getTitle()+ "String_Node_Str");
  addInfoTableEntry("String_Node_Str",getUser());
}

Fixed version (ground truth):
@Override public void initInfoTable(){
  setInfoTableTitle("String_Node_Str");
  addInfoTableEntry("String_Node_Str","String_Node_Str" + BackupTubeCommon.escapeURL(getUrl()) + "String_Node_Str"+ getTitle()+ "String_Node_Str");
  addInfoTableEntry("String_Node_Str",getUser());
}
Program: 7625
Project: 7625
Buggy source:
public static void saveDataFile(File dataFeedFile,BackupTubeDataFile dataFile){
  if (dataFeedFile.exists()) {
    dataFeedFile.delete();
  }
  try {
    String json=new Gson().toJson(dataFile,BackupTubeDataFile.class);
    PrintWriter writer=new PrintWriter(dataFeedFile);
    writer.write(json);
    writer.close();
  }
 catch (  IOException ex) {
    System.err.println("String_Node_Str");
    System.exit(0);
  }
}

Fixed version (ground truth):
public static void saveDataFile(File dataFeedFile,BackupTubeDataFile dataFile){
  if (dataFeedFile.exists()) {
    dataFeedFile.delete();
  }
  try {
    String json=BackupTubeCommon.getPrettyGson().toJson(dataFile,BackupTubeDataFile.class);
    PrintWriter writer=new PrintWriter(dataFeedFile);
    writer.write(json);
    writer.close();
  }
 catch (  IOException ex) {
    System.err.println("String_Node_Str");
    System.exit(0);
  }
}
Program: 7627
Project: 7627
Buggy source:
public boolean testMove(BlockPosition pos){
  World world=pos.getWorld();
  Block block=world.getBlockAt(pos.toLocation());
  if (block != null) {
    if (!isEmptyBlock(block)) {
      MagnetBlockBlock mblock=getBlock(new BlockPosition(block));
      if (mblock.getStructure() != null && mblock.getStructure().equals(structure)) {
        return true;
      }
 else {
        plugin.log.log(Level.INFO,"String_Node_Str" + structure);
      }
      plugin.log.log(Level.INFO,"String_Node_Str" + block.getType().toString() + "String_Node_Str");
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean testMove(BlockPosition pos){
  World world=pos.getWorld();
  Block block=world.getBlockAt(pos.toLocation());
  if (block != null) {
    if (!isEmptyBlock(block)) {
      MagnetBlockBlock mblock=getBlock(new BlockPosition(block));
      block=mblock.getBlock();
      if (mblock.getStructure() != null && mblock.getStructure().equals(structure)) {
        return true;
      }
 else       if (mblock.getStructure() == null) {
        return true;
      }
 else {
        plugin.log.log(Level.INFO,"String_Node_Str" + structure);
      }
      plugin.log.log(Level.INFO,"String_Node_Str" + block.getType().toString() + "String_Node_Str");
      return false;
    }
  }
  return true;
}
Program: 7628
Project: 7628
Buggy source:
public StructureAnimation(MagnetBlockStructure structure,BlockPosition targetPos){
  this.structure=structure;
  targetPosition=targetPos;
  toPos=targetPos.toLocation().toVector();
  currentPos=structure.getOrigin().toLocation().toVector();
}

Fixed version (ground truth):
public StructureAnimation(MagnetBlockStructure structure,BlockPosition targetPos){
  this.structure=structure;
  targetPosition=targetPos;
  toPos=targetPos.toLocation().toVector();
  currentPos=structure.getOrigin().toLocation().toVector();
  Vector v=toPos.clone().subtract(currentPos).normalize();
  v.setX(Math.round(v.getX()));
  v.setY(Math.round(v.getY()));
  v.setZ(Math.round(v.getZ()));
  neededsteps=(int)(toPos.clone().subtract(currentPos.clone()).length() / v.length());
}
Program: 7629
Project: 7629
Buggy source:
public boolean isSolidBlock(){
  Material t=getBlock().getType();
  if (t.equals(Material.BED_BLOCK) || t.equals(Material.IRON_DOOR_BLOCK) || t.equals(Material.WOOD_DOOR)|| t.equals(Material.WOOD_PLATE)|| t.equals(Material.STONE_PLATE)|| t.equals(Material.TORCH)|| t.equals(Material.REDSTONE_WIRE)|| t.equals(Material.REDSTONE_TORCH_OFF)|| t.equals(Material.REDSTONE_TORCH_ON)|| t.equals(Material.RED_MUSHROOM)|| t.equals(Material.YELLOW_FLOWER)|| t.equals(Material.LADDER)|| t.equals(Material.SIGN)|| t.equals(Material.WALL_SIGN)|| t.equals(Material.SIGN_POST)|| t.equals(Material.LEVER)|| t.equals(Material.BROWN_MUSHROOM)|| t.equals(Material.CACTUS)|| t.equals(Material.CROPS)|| t.equals(Material.DIODE_BLOCK_OFF)|| t.equals(Material.DIODE_BLOCK_ON)|| t.equals(Material.PORTAL)|| t.equals(Material.RAILS)|| t.equals(Material.SAPLING)|| t.equals(Material.SNOW)|| t.equals(Material.SUGAR_CANE_BLOCK)|| t.equals(Material.WALL_SIGN)|| t.equals(Material.RED_ROSE)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isSolidBlock(){
  Material t=getBlock().getType();
  if (t.equals(Material.BED_BLOCK) || t.equals(Material.IRON_DOOR_BLOCK) || t.equals(Material.WOOD_DOOR)|| t.equals(Material.WOOD_PLATE)|| t.equals(Material.STONE_PLATE)|| t.equals(Material.TORCH)|| t.equals(Material.REDSTONE_WIRE)|| t.equals(Material.REDSTONE_TORCH_OFF)|| t.equals(Material.REDSTONE_TORCH_ON)|| t.equals(Material.RED_MUSHROOM)|| t.equals(Material.YELLOW_FLOWER)|| t.equals(Material.LADDER)|| t.equals(Material.SIGN)|| t.equals(Material.WALL_SIGN)|| t.equals(Material.SIGN_POST)|| t.equals(Material.LEVER)|| t.equals(Material.BROWN_MUSHROOM)|| t.equals(Material.CACTUS)|| t.equals(Material.CROPS)|| t.equals(Material.DIODE_BLOCK_OFF)|| t.equals(Material.DIODE_BLOCK_ON)|| t.equals(Material.PORTAL)|| t.equals(Material.RAILS)|| t.equals(Material.SAPLING)|| t.equals(Material.SNOW)|| t.equals(Material.SUGAR_CANE_BLOCK)|| t.equals(Material.WALL_SIGN)|| t.equals(Material.RED_ROSE)|| t.equals(Material.COBBLESTONE_STAIRS)|| t.equals(Material.REDSTONE_ORE)|| t.equals(Material.GLOWING_REDSTONE_ORE)|| t.equals(Material.STONE_BUTTON)|| t.equals(Material.FIRE)|| t.equals(Material.SUGAR_CANE)|| t.equals(Material.SUGAR_CANE_BLOCK)|| t.equals(Material.POWERED_RAIL)|| t.equals(Material.DETECTOR_RAIL)|| t.equals(Material.BURNING_FURNACE)|| t.equals(Material.PUMPKIN_STEM)|| t.equals(Material.MELON_STEM)|| t.equals(Material.PISTON_MOVING_PIECE)|| t.equals(Material.TRAP_DOOR)|| t.equals(Material.FENCE_GATE)) {
    return false;
  }
  return true;
}
Program: 7632
Project: 7632
Buggy source:
@Override @Transactional public void placeBet(Bet bet){
  PlaceBetsReq placeBetsReq=new PlaceBetsReq();
  placeBetsReq.setBets(new ArrayOfPlaceBets());
  Strategy strategy=bet.getStrategy();
  BigDecimal liability=strategy.getLiability().divide(new BigDecimal(bet.getTimings().size()));
  Pricing bestPricing=BettingUtil.bestPrice(bet.getHorse().getPrices(),strategy.getAspect());
  if (bestPricing.getPrice().compareTo(strategy.getMaxOdds()) <= 0 && bestPricing.getPrice().compareTo(strategy.getMinOdds()) >= 0) {
    if (strategy.getChasePriceByTick() == 0) {
      if (bestPricing.getAmountAvailable().compareTo(liability) >= 0) {
        placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,liability,bestPricing.getPrice()));
      }
 else {
        placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,bestPricing.getAmountAvailable(),bestPricing.getPrice()));
        placeBetsReq.getBets().getPlaceBets().add(createLimitedSPBet(bet,liability.subtract(bestPricing.getAmountAvailable())));
      }
    }
 else {
      placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,liability,BettingUtil.findChasePrice(bestPricing.getPrice(),strategy.getChasePriceByTick(),strategy.getAspect())));
    }
  }
 else {
    placeBetsReq.getBets().getPlaceBets().add(createLimitedSPBet(bet,liability));
  }
  sendRequest(placeBetsReq);
}

Fixed version (ground truth):
@Override @Transactional public void placeBet(Bet bet){
  PlaceBetsReq placeBetsReq=new PlaceBetsReq();
  placeBetsReq.setBets(new ArrayOfPlaceBets());
  Strategy strategy=bet.getStrategy();
  BigDecimal liability=strategy.getLiability().divide(new BigDecimal(bet.getNumberOfSplits()),BigDecimal.ROUND_HALF_UP);
  Pricing bestPricing=BettingUtil.bestPrice(bet.getHorse().getPrices(),strategy.getAspect());
  if (bestPricing.getPrice().compareTo(strategy.getMaxOdds()) <= 0 && bestPricing.getPrice().compareTo(strategy.getMinOdds()) >= 0) {
    if (strategy.getChasePriceByTick() == 0) {
      if (bestPricing.getAmountAvailable().compareTo(liability) >= 0) {
        placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,liability,bestPricing.getPrice()));
      }
 else {
        placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,bestPricing.getAmountAvailable(),bestPricing.getPrice()));
        placeBetsReq.getBets().getPlaceBets().add(createLimitedSPBet(bet,liability.subtract(bestPricing.getAmountAvailable())));
      }
    }
 else {
      placeBetsReq.getBets().getPlaceBets().add(createMOCExchangeBet(bet,liability,BettingUtil.findChasePrice(bestPricing.getPrice(),strategy.getChasePriceByTick(),strategy.getAspect())));
    }
  }
 else {
    placeBetsReq.getBets().getPlaceBets().add(createLimitedSPBet(bet,liability));
  }
  sendRequest(placeBetsReq);
}
Program: 7633
Project: 7633
Buggy source:
public static BigDecimal findChasePrice(BigDecimal price,int ticks,BettingAspect aspect){
  return aspect == BettingAspect.BACK ? PRICE_TICKS.get(PRICE_TICKS.indexOf(price) + ticks) : PRICE_TICKS.get(PRICE_TICKS.indexOf(price) - ticks);
}

Fixed version (ground truth):
public static BigDecimal findChasePrice(BigDecimal price,int ticks,BettingAspect aspect){
  return aspect == BettingAspect.BACK ? PRICE_TICKS.get(PRICE_TICKS.indexOf(price.stripTrailingZeros()) + ticks) : PRICE_TICKS.get(PRICE_TICKS.indexOf(price.stripTrailingZeros()) - ticks);
}
Program: 7634
Project: 7634
Buggy source:
public static BigDecimal libilityToStake(BigDecimal liability,BigDecimal price){
  return liability.divide(price.subtract(BigDecimal.ONE));
}

Fixed version (ground truth):
public static BigDecimal libilityToStake(BigDecimal liability,BigDecimal price){
  return liability.divide(price.subtract(BigDecimal.ONE),BigDecimal.ROUND_HALF_UP);
}
Program: 7635
Project: 7635
Buggy source:
/** 
 * @param args
 * @throws Exception 
 * @throws CamelExecutionException 
 */
public static void main(String[] args) throws CamelExecutionException, Exception {
  final ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
  final ScheduledService scheduledService=(ScheduledService)applicationContext.getBean("String_Node_Str");
  scheduledService.getAllRacePrices();
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws Exception 
 * @throws CamelExecutionException 
 */
public static void main(String[] args) throws CamelExecutionException, Exception {
  final ApplicationContext applicationContext=new ClassPathXmlApplicationContext("String_Node_Str");
}
Program: 7636
Project: 7636
Buggy source:
/** 
 * M�todo para levantar os servi�os do OpenORB de mapa de nomes e f�brica de canais de eventos
 */
private void riseOpenORB(){
  Runtime r=Runtime.getRuntime();
  try {
    Process p;
    BufferedReader bfr;
    String msg;
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    p=r.exec("String_Node_Str");
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    p=r.exec("String_Node_Str");
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Método para levantar os serviços do OpenORB de mapa de nomes e fábrica de canais de eventos
 */
private void riseOpenORB(){
  Runtime r=Runtime.getRuntime();
  try {
    Process p;
    BufferedReader bfr;
    String msg;
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    p=r.exec("String_Node_Str");
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    p=r.exec("String_Node_Str");
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
    bfr=new BufferedReader(new InputStreamReader(p.getErrorStream()));
    while ((msg=bfr.readLine()) != null) {
      System.out.println(msg);
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 7637
Project: 7637
Buggy source:
@Override public void setTimingHandler(TimingHandler h){
  handler=h;
  animationTimer=new SeqTimer(handler);
}

Fixed version (ground truth):
@Override public void setTimingHandler(TimingHandler h){
  handler=h;
  handler.registerAnimatable(this);
  animationTimer=new SeqTimer(handler);
}
Program: 7638
Project: 7638
Buggy source:
/** 
 * public void handle(GenericEvent event) { if(event == null)	return;		 if(updateGrabber(event)) return;		 if(event instanceof GenericMotionEvent && event instanceof Duoble<?>) { ((GenericMotionEvent)event).modulate(sens); if (deviceGrabber() != null ) scene.enqueueEvent(new EventGrabberTuple(event, frameProfile().handle((Duoble<?>)event), deviceGrabber())); else scene.enqueueEvent(new EventGrabberTuple(event, cameraProfile().handle((Duoble<?>)event), null)); } }
 */
@Override public void handle(THEvent event){
  if (event == null || !handler.isAgentRegistered(this))   return;
  if (event instanceof Duoble<?>) {
    if (event instanceof THClickEvent)     handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,clickProfile().handle((Duoble<?>)event),grabber()));
 else     if (event instanceof THMotionEvent) {
      ((THMotionEvent)event).modulate(sens);
      if (trackedGrabber() != null)       if (event instanceof DOF1Event)       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,frameWheelProfile().handle((Duoble<?>)event),trackedGrabber()));
 else       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,frameProfile().handle((Duoble<?>)event),trackedGrabber()));
 else       if (event instanceof DOF1Event)       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,wheelProfile().handle((Duoble<?>)event),defaultGrabber()));
 else       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,cameraProfile().handle((Duoble<?>)event),defaultGrabber()));
    }
  }
}

Fixed version (ground truth):
/** 
 * public void handle(GenericEvent event) { if(event == null)	return;		 if(updateGrabber(event)) return;		 if(event instanceof GenericMotionEvent && event instanceof Duoble<?>) { ((GenericMotionEvent)event).modulate(sens); if (deviceGrabber() != null ) scene.enqueueEvent(new EventGrabberTuple(event, frameProfile().handle((Duoble<?>)event), deviceGrabber())); else scene.enqueueEvent(new EventGrabberTuple(event, cameraProfile().handle((Duoble<?>)event), null)); } }
 */
@Override public void handle(THEvent event){
  if (event == null || !handler.isAgentRegistered(this))   return;
  if (event instanceof Duoble<?>) {
    if (event instanceof THClickEvent)     handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,clickProfile().handle((Duoble<?>)event),grabber()));
 else     if (event instanceof THMotionEvent) {
      ((THMotionEvent)event).modulate(sens);
      if (trackedGrabber() != null)       if (event instanceof GenericDOF1Event)       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,frameWheelProfile().handle((Duoble<?>)event),trackedGrabber()));
 else       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,frameProfile().handle((Duoble<?>)event),trackedGrabber()));
 else       if (event instanceof GenericDOF1Event)       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,wheelProfile().handle((Duoble<?>)event),defaultGrabber()));
 else       handler.enqueueEventTuple(new EventGrabberDuobleTuple(event,cameraProfile().handle((Duoble<?>)event),defaultGrabber()));
    }
  }
}
Program: 7639
Project: 7639
Buggy source:
@Override public DOF6Event feed(){
  return null;
}

Fixed version (ground truth):
@Override public GenericDOF6Event<Constants.DOF_6Action> feed(){
  return null;
}
Program: 7640
Project: 7640
Buggy source:
@Override public DOF2Event feed(){
  return null;
}

Fixed version (ground truth):
@Override public GenericDOF2Event<Constants.DOF_2Action> feed(){
  return null;
}
Program: 7641
Project: 7641
Buggy source:
public P5KeyboardAgent(AbstractScene scn,String n){
  super(new GenericKeyboardProfile<Constants.DOF_0Action>(),scn.terseHandler(),n);
  setDefaultGrabber(scn);
  keyboardProfile().setShortcut('a',DOF_0Action.DRAW_AXIS);
  keyboardProfile().setShortcut('f',DOF_0Action.DRAW_FRAME_SELECTION_HINT);
  keyboardProfile().setShortcut('g',DOF_0Action.DRAW_GRID);
  keyboardProfile().setShortcut('i',DOF_0Action.FOCUS_INTERACTIVE_FRAME);
  keyboardProfile().setShortcut(' ',DOF_0Action.CAMERA_PROFILE);
  keyboardProfile().setShortcut('e',DOF_0Action.CAMERA_TYPE);
  keyboardProfile().setShortcut('h',DOF_0Action.GLOBAL_HELP);
  keyboardProfile().setShortcut('H',DOF_0Action.CURRENT_CAMERA_PROFILE_HELP);
  keyboardProfile().setShortcut('r',DOF_0Action.EDIT_CAMERA_PATH);
  keyboardProfile().setShortcut('s',DOF_0Action.INTERPOLATE_TO_FIT_SCENE);
  keyboardProfile().setShortcut('S',DOF_0Action.SHOW_ALL);
  keyboardProfile().setShortcut(KeyboardEvent.TH_RIGHT,DOF_0Action.MOVE_CAMERA_RIGHT);
  keyboardProfile().setShortcut(KeyboardEvent.TH_LEFT,DOF_0Action.MOVE_CAMERA_LEFT);
  keyboardProfile().setShortcut(KeyboardEvent.TH_UP,DOF_0Action.MOVE_CAMERA_UP);
  keyboardProfile().setShortcut(KeyboardEvent.TH_DOWN,DOF_0Action.MOVE_CAMERA_DOWN);
  keyboardProfile().setShortcut((KeyboardEvent.TH_ALT | KeyboardEvent.TH_SHIFT),'l',DOF_0Action.MOVE_CAMERA_LEFT);
}

Fixed version (ground truth):
public P5KeyboardAgent(AbstractScene scn,String n){
  super(new GenericKeyboardProfile<Constants.DOF_0Action>(),scn.terseHandler(),n);
  setDefaultGrabber(scn);
  keyboardProfile().setShortcut('a',DOF_0Action.DRAW_AXIS);
  keyboardProfile().setShortcut('f',DOF_0Action.DRAW_FRAME_SELECTION_HINT);
  keyboardProfile().setShortcut('g',DOF_0Action.DRAW_GRID);
  keyboardProfile().setShortcut('i',DOF_0Action.FOCUS_INTERACTIVE_FRAME);
  keyboardProfile().setShortcut(' ',DOF_0Action.CAMERA_PROFILE);
  keyboardProfile().setShortcut('e',DOF_0Action.CAMERA_TYPE);
  keyboardProfile().setShortcut('h',DOF_0Action.GLOBAL_HELP);
  keyboardProfile().setShortcut('H',DOF_0Action.CURRENT_CAMERA_PROFILE_HELP);
  keyboardProfile().setShortcut('r',DOF_0Action.EDIT_CAMERA_PATH);
  keyboardProfile().setShortcut('s',DOF_0Action.INTERPOLATE_TO_FIT_SCENE);
  keyboardProfile().setShortcut('S',DOF_0Action.SHOW_ALL);
  keyboardProfile().setShortcut(GenericKeyboardEvent.TH_RIGHT,DOF_0Action.MOVE_CAMERA_RIGHT);
  keyboardProfile().setShortcut(GenericKeyboardEvent.TH_LEFT,DOF_0Action.MOVE_CAMERA_LEFT);
  keyboardProfile().setShortcut(GenericKeyboardEvent.TH_UP,DOF_0Action.MOVE_CAMERA_UP);
  keyboardProfile().setShortcut(GenericKeyboardEvent.TH_DOWN,DOF_0Action.MOVE_CAMERA_DOWN);
  keyboardProfile().setShortcut((GenericKeyboardEvent.TH_ALT | GenericKeyboardEvent.TH_SHIFT),'l',DOF_0Action.MOVE_CAMERA_LEFT);
}
Program: 7642
Project: 7642
Buggy source:
@Override public KeyboardEvent feed(){
  return null;
}

Fixed version (ground truth):
@Override public GenericKeyboardEvent<Constants.DOF_0Action> feed(){
  return null;
}
Program: 7643
Project: 7643
Buggy source:
@Override public boolean checkIfGrabsInput(THEvent event){
  return (event instanceof KeyboardEvent || event instanceof ClickEvent);
}

Fixed version (ground truth):
@Override public boolean checkIfGrabsInput(THEvent event){
  return (event instanceof GenericKeyboardEvent || event instanceof GenericClickEvent);
}
Program: 7646
Project: 7646
Buggy source:
/** 
 * Returns a Quaternion computed according to mouse motion. The Quaternion is computed as composition of two rotations (quaternions): 1. Mouse motion along the screen X Axis rotates the camera along the   {@link #getCADAxis()}. 2. Mouse motion along the screen Y axis rotates the camera along its X axis.
 * @see #getCADAxis()
 */
protected Quat computeCADQuaternion(DOF2Event event,float cx,float cy,Pinhole camera){
  if (!(camera instanceof Camera))   throw new RuntimeException("String_Node_Str");
  float x=event.getX();
  float y=event.getY();
  float prevX=event.getPrevX();
  float prevY=event.getPrevY();
  float px=rotationSensitivity() * ((int)prevX - cx) / camera.screenWidth();
  float py=rotationSensitivity() * (scene.isLeftHanded() ? ((int)prevY - cy) : ((cy - (int)prevY))) / camera.screenHeight();
  float dx=rotationSensitivity() * (x - cx) / camera.screenWidth();
  float dy=rotationSensitivity() * (scene.isLeftHanded() ? (y - cy) : (cy - y)) / camera.screenHeight();
  Vec axisX=new Vec(1,0,0);
  Vec world2camAxis=camera.frame().transformOf(worldAxis);
  float angleWorldAxis=rotationSensitivity() * (scene.isLeftHanded() ? (dx - px) : (px - dx));
  float angleX=rotationSensitivity() * (dy - py);
  Quat quatWorld=new Quat(world2camAxis,angleWorldAxis);
  Quat quatX=new Quat(axisX,angleX);
  return Quat.multiply(quatWorld,quatX);
}

Fixed version (ground truth):
/** 
 * Returns a Quaternion computed according to mouse motion. The Quaternion is computed as composition of two rotations (quaternions): 1. Mouse motion along the screen X Axis rotates the camera along the   {@link #getCADAxis()}. 2. Mouse motion along the screen Y axis rotates the camera along its X axis.
 * @see #getCADAxis()
 */
protected Quat computeCADQuaternion(GenericDOF2Event<?> event,float cx,float cy,Pinhole camera){
  if (!(camera instanceof Camera))   throw new RuntimeException("String_Node_Str");
  float x=event.getX();
  float y=event.getY();
  float prevX=event.getPrevX();
  float prevY=event.getPrevY();
  float px=rotationSensitivity() * ((int)prevX - cx) / camera.screenWidth();
  float py=rotationSensitivity() * (scene.isLeftHanded() ? ((int)prevY - cy) : ((cy - (int)prevY))) / camera.screenHeight();
  float dx=rotationSensitivity() * (x - cx) / camera.screenWidth();
  float dy=rotationSensitivity() * (scene.isLeftHanded() ? (y - cy) : (cy - y)) / camera.screenHeight();
  Vec axisX=new Vec(1,0,0);
  Vec world2camAxis=camera.frame().transformOf(worldAxis);
  float angleWorldAxis=rotationSensitivity() * (scene.isLeftHanded() ? (dx - px) : (px - dx));
  float angleX=rotationSensitivity() * (dy - py);
  Quat quatWorld=new Quat(world2camAxis,angleWorldAxis);
  Quat quatX=new Quat(axisX,angleX);
  return Quat.multiply(quatWorld,quatX);
}
Program: 7647
Project: 7647
Buggy source:
/** 
 * Returns a Quaternion that is a rotation around current camera Y, proportional to the horizontal mouse position.
 */
protected final Quat turnQuaternion(DOF1Event event,Camera camera){
  float x=event.getX();
  float prevX=event.getPrevX();
  return new Quat(new Vec(0.0f,1.0f,0.0f),rotationSensitivity() * ((int)prevX - x) / camera.screenWidth());
}

Fixed version (ground truth):
/** 
 * Returns a Quaternion that is a rotation around current camera Y, proportional to the horizontal mouse position.
 */
protected final Quat turnQuaternion(GenericDOF1Event<?> event,Camera camera){
  float x=event.getX();
  float prevX=event.getPrevX();
  return new Quat(new Vec(0.0f,1.0f,0.0f),rotationSensitivity() * ((int)prevX - x) / camera.screenWidth());
}
Program: 7648
Project: 7648
Buggy source:
/** 
 * Returns a Quaternion that is the composition of two rotations, inferred from the mouse pitch (X axis) and yaw (  {@link #flyUpVector()} axis).
 */
protected final Quat pitchYawQuaternion(DOF2Event event,Camera camera){
  float x=event.getX();
  float y=event.getY();
  float prevX=event.getPrevX();
  float prevY=event.getPrevY();
  int deltaY;
  if (scene.isRightHanded())   deltaY=(int)(prevY - y);
 else   deltaY=(int)(y - prevY);
  Quat rotX=new Quat(new Vec(1.0f,0.0f,0.0f),rotationSensitivity() * deltaY / camera.screenHeight());
  Quat rotY=new Quat(transformOf(flyUpVector(),false),rotationSensitivity() * ((int)prevX - x) / camera.screenWidth());
  return Quat.multiply(rotY,rotX);
}

Fixed version (ground truth):
/** 
 * Returns a Quaternion that is the composition of two rotations, inferred from the mouse pitch (X axis) and yaw (  {@link #flyUpVector()} axis).
 */
protected final Quat pitchYawQuaternion(GenericDOF2Event<?> event,Camera camera){
  float x=event.getX();
  float y=event.getY();
  float prevX=event.getPrevX();
  float prevY=event.getPrevY();
  int deltaY;
  if (scene.isRightHanded())   deltaY=(int)(prevY - y);
 else   deltaY=(int)(y - prevY);
  Quat rotX=new Quat(new Vec(1.0f,0.0f,0.0f),rotationSensitivity() * deltaY / camera.screenHeight());
  Quat rotY=new Quat(transformOf(flyUpVector(),false),rotationSensitivity() * ((int)prevX - x) / camera.screenWidth());
  return Quat.multiply(rotY,rotX);
}
Program: 7650
Project: 7650
Buggy source:
protected void modified(){
  kernel().modified();
}

Fixed version (ground truth):
/** 
 * Resets the cache of all KeyFrameInterpolators' associated with this Frame.
 */
protected void modified(){
  if (VFrame.this instanceof InteractiveCameraFrame)   ((InteractiveCameraFrame)VFrame.this).pinhole().lastFrameUpdate=((InteractiveCameraFrame)VFrame.this).scene.frameCount();
  Iterator<KeyFrameInterpolator> it=list.iterator();
  while (it.hasNext()) {
    it.next().invalidateValues();
  }
}
Program: 7652
Project: 7652
Buggy source:
/** 
 * Internal method. Handles the different mouse click actions.
 */
protected void handleClickAction(ClickAction action,Point p){
switch (action) {
case NO_CLICK_ACTION:
    break;
case ZOOM_ON_PIXEL:
  if (Camera.class == camera().getClass())   System.out.println("String_Node_Str" + "String_Node_Str");
 else {
    Camera.WorldPoint wP=interpolateToZoomOnPixel(p);
    if (wP.found) {
      pupVec=wP.point;
      pupFlag=true;
      if (timerFx.timer() != null)       timerFx.timer().runTimerOnce(1000);
    }
  }
break;
case ZOOM_TO_FIT:
camera().interpolateToFitScene();
break;
case ARP_FROM_PIXEL:
if (Camera.class == camera().getClass()) PApplet.println("String_Node_Str" + "String_Node_Str");
 else if (setArcballReferencePointFromPixel(p)) {
arpFlag=true;
if (timerFx.timer() != null) timerFx.timer().runTimerOnce(1000);
}
break;
case RESET_ARP:
camera().setArcballReferencePoint(new Vector3D(0,0,0));
arpFlag=true;
if (timerFx.timer() != null) timerFx.timer().runTimerOnce(1000);
break;
case CENTER_FRAME:
if (interactiveFrame() != null) interactiveFrame().projectOnLine(camera().position(),camera().viewDirection());
break;
case CENTER_SCENE:
camera().centerScene();
break;
case SHOW_ALL:
camera().showEntireScene();
break;
case ALIGN_FRAME:
if (interactiveFrame() != null) interactiveFrame().alignWithFrame(camera().frame());
break;
case ALIGN_CAMERA:
camera().frame().alignWithFrame(null,true);
break;
}
}

Fixed version (ground truth):
/** 
 * Internal method. Handles the different mouse click actions.
 */
protected void handleClickAction(ClickAction action,Point p){
switch (action) {
case NO_CLICK_ACTION:
    break;
case ZOOM_ON_PIXEL:
  if (Camera.class == camera().getClass())   System.out.println("String_Node_Str" + "String_Node_Str");
 else {
    Camera.WorldPoint wP=interpolateToZoomOnPixel(p);
    if (wP.found) {
      pupVec=wP.point;
      pupFlag=true;
      if (timerFx.timer() != null)       timerFx.timer().runTimerOnce(1000);
    }
  }
break;
case ZOOM_TO_FIT:
camera().interpolateToFitScene();
break;
case ARP_FROM_PIXEL:
if (Camera.class == camera().getClass()) System.out.println("String_Node_Str" + "String_Node_Str");
 else if (setArcballReferencePointFromPixel(p)) {
arpFlag=true;
if (timerFx.timer() != null) timerFx.timer().runTimerOnce(1000);
}
break;
case RESET_ARP:
camera().setArcballReferencePoint(new Vector3D(0,0,0));
arpFlag=true;
if (timerFx.timer() != null) timerFx.timer().runTimerOnce(1000);
break;
case CENTER_FRAME:
if (interactiveFrame() != null) interactiveFrame().projectOnLine(camera().position(),camera().viewDirection());
break;
case CENTER_SCENE:
camera().centerScene();
break;
case SHOW_ALL:
camera().showEntireScene();
break;
case ALIGN_FRAME:
if (interactiveFrame() != null) interactiveFrame().alignWithFrame(camera().frame());
break;
case ALIGN_CAMERA:
camera().frame().alignWithFrame(null,true);
break;
}
}
Program: 7653
Project: 7653
Buggy source:
/** 
 * Unselect the currently selected POI for a given player.
 * @param player
 */
public void unselectPoi(Player player){
  this._selectedPOIs.remove(player);
  PointsOfInterest.notifyListeners(PoiEvent.unselectEvent(player));
}

Fixed version (ground truth):
/** 
 * Unselect the currently selected POI for a given player if it matches the given id.
 * @param player
 */
public void unselectPoi(Player player,int poiID){
  if (_selectedPOIs.containsKey(player) && _selectedPOIs.get(player).getId() == poiID) {
    unselectPoi(player);
  }
}
Program: 7654
Project: 7654
Buggy source:
/** 
 * EventHandler for player putting a compass in their hand.
 */
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onEquipCompass(PlayerItemHeldEvent event){
  try {
    Player player=event.getPlayer();
    if (player.getInventory().getItem(event.getNewSlot()).getType().equals(Material.COMPASS)) {
      player.sendMessage("String_Node_Str");
      player.sendMessage(ChatColor.YELLOW + "String_Node_Str");
      player.sendMessage(ChatColor.YELLOW + "String_Node_Str");
    }
  }
 catch (  Exception ignore) {
  }
}

Fixed version (ground truth):
/** 
 * EventHandler for player putting a compass in their hand.
 */
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void onEquipCompass(PlayerItemHeldEvent event){
  try {
    Player player=event.getPlayer();
    if (player.hasPermission("String_Node_Str") && player.getInventory().getItem(event.getNewSlot()).getType().equals(Material.COMPASS)) {
      player.sendMessage("String_Node_Str");
      player.sendMessage(ChatColor.YELLOW + "String_Node_Str" + ChatColor.GOLD+ "String_Node_Str"+ ChatColor.YELLOW+ "String_Node_Str");
      player.sendMessage(ChatColor.YELLOW + "String_Node_Str");
    }
  }
 catch (  Exception ignore) {
  }
}