nus-yam/ex-repair huggingface dataset:
Program: 178796
Project: 178796
Buggy source:
public void updateLocation(){
  String[] loc=((String)settings.get(RegionSetting.LOCATION)).split("String_Node_Str");
  String[] loc1=loc[1].split("String_Node_Str");
  PointOne=new Vector(Integer.parseInt(loc1[0]),Integer.parseInt(loc1[1]),Integer.parseInt(loc1[2]));
  String[] loc2=loc[2].split("String_Node_Str");
  PointTwo=new Vector(Integer.parseInt(loc2[0]),Integer.parseInt(loc2[1]),Integer.parseInt(loc2[2]));
  World=loc[0];
}

Fixed version (ground truth):
public void updateLocation(){
  String[] loc=((String)settings.get(RegionSetting.LOCATION)).split("String_Node_Str");
  String[] loc1=loc[1].split("String_Node_Str");
  PointOne=new Vector(Double.parseDouble(loc1[0]),Double.parseDouble(loc1[1]),Double.parseDouble(loc1[2]));
  String[] loc2=loc[2].split("String_Node_Str");
  PointTwo=new Vector(Double.parseDouble(loc2[0]),Double.parseDouble(loc2[1]),Double.parseDouble(loc2[2]));
  World=loc[0];
}
Program: 178797
Project: 178797
Buggy source:
public boolean run(CommandSender sender,String[] args){
  this.sender=sender;
  if (args.length > 1) {
    int i=1;
    while (i < args.length) {
      this.args.add(args[i]);
    }
  }
  if (argLength != (args.length - 1)) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  return execute();
}

Fixed version (ground truth):
public boolean run(CommandSender sender,String[] preArgs){
  this.sender=sender;
  for (  String arg : preArgs)   args.add(arg);
  args.remove(0);
  if (argLength != args.size()) {
    sendUsage();
    return true;
  }
  if (bePlayer && !(sender instanceof Player))   return false;
  player=(Player)sender;
  return execute();
}
Program: 178798
Project: 178798
Buggy source:
public boolean execute(){
  if (!Permission.adminRegions(player))   return false;
  User user=PortalStick.players.get(player.getName());
  if (user.getPointOne() == null || user.getPointTwo() == null)   Util.sendMessage(sender,"String_Node_Str");
 else   if (RegionManager.getRegion(args.get(0)) != null)   Util.sendMessage(sender,"String_Node_Str");
 else {
    RegionManager.createRegion(args.get(0),user.getPointOne(),user.getPointTwo());
  }
  return false;
}

Fixed version (ground truth):
public boolean execute(){
  if (!Permission.adminRegions(player))   return false;
  User user=PortalStick.players.get(player.getName());
  if (user.getPointOne() == null || user.getPointTwo() == null)   Util.sendMessage(sender,"String_Node_Str");
 else   if (RegionManager.getRegion(args.get(0)) != null)   Util.sendMessage(sender,"String_Node_Str");
 else {
    Util.sendMessage(sender,"String_Node_Str" + args.get(0) + "String_Node_Str");
    RegionManager.createRegion(args.get(0),user.getPointOne(),user.getPointTwo());
  }
  return true;
}
Program: 178800
Project: 178800
Buggy source:
public void updateLocation(){
  String[] loc=((String)settings.get(RegionSetting.LOCATION)).split("String_Node_Str");
  String[] loc1=loc[1].split("String_Node_Str");
  PointOne=new Vector(Integer.parseInt(loc1[0]),Integer.parseInt(loc1[1]),Integer.parseInt(loc1[2]));
  String[] loc2=loc[2].split("String_Node_Str");
  PointOne=new Vector(Integer.parseInt(loc2[0]),Integer.parseInt(loc2[1]),Integer.parseInt(loc2[2]));
  World=loc[0];
}

Fixed version (ground truth):
public void updateLocation(){
  String[] loc=((String)settings.get(RegionSetting.LOCATION)).split("String_Node_Str");
  String[] loc1=loc[1].split("String_Node_Str");
  PointOne=new Vector(Integer.parseInt(loc1[0]),Integer.parseInt(loc1[1]),Integer.parseInt(loc1[2]));
  String[] loc2=loc[2].split("String_Node_Str");
  PointTwo=new Vector(Integer.parseInt(loc2[0]),Integer.parseInt(loc2[1]),Integer.parseInt(loc2[2]));
  World=loc[0];
}
Program: 178801
Project: 178801
Buggy source:
public void onBlockIgnite(BlockIgniteEvent event){
  if (event.getPlayer() == null)   return;
  Player player=event.getPlayer();
  if (event.getCause() == IgniteCause.FLINT_AND_STEEL) {
    if (!Permission.createGrill(event.getPlayer()))     return;
    if (!Config.EnabledWorlds.contains(player.getLocation().getWorld().getName())) {
      Util.sendMessage(player,Config.MessageRestrictedWorld);
      return;
    }
    if (GrillManager.placeEmancipationGrill(event.getBlock().getRelative(0,-1,0)))     event.setCancelled(true);
  }
}

Fixed version (ground truth):
public void onBlockIgnite(BlockIgniteEvent event){
  if (event.getPlayer() == null)   return;
  Player player=event.getPlayer();
  if (event.getCause() == IgniteCause.FLINT_AND_STEEL) {
    if (!Permission.createGrill(event.getPlayer()))     return;
    if (Config.DisabledWorlds.contains(player.getLocation().getWorld().getName())) {
      Util.sendMessage(player,Config.MessageRestrictedWorld);
      return;
    }
    if (GrillManager.placeRecursiveEmancipationGrill(event.getBlock().getRelative(0,-1,0)))     event.setCancelled(true);
  }
}
Program: 178804
Project: 178804
Buggy source:
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  User user=PortalStick.players.get(player.getName());
  if (Config.DeleteOnQuit)   PortalManager.deletePortals(user);
  Region region=RegionManager.getRegion(player.getLocation());
  if (region.Name != "String_Node_Str" && region.getBoolean(RegionSetting.UNIQUE_INVENTORY))   player.getInventory().setContents(user.getInventory().getContents());
  PortalStick.players.remove(player.getName());
}

Fixed version (ground truth):
public void onPlayerQuit(PlayerQuitEvent event){
  Player player=event.getPlayer();
  User user=PortalStick.players.get(player.getName());
  Region region=RegionManager.getRegion(player.getLocation());
  if (region.Name != "String_Node_Str" && region.getBoolean(RegionSetting.UNIQUE_INVENTORY))   player.getInventory().setContents(user.getInventory().getContents());
  if (Config.DeleteOnQuit) {
    PortalManager.deletePortals(user);
    PortalStick.players.remove(player.getName());
  }
}
Program: 178805
Project: 178805
Buggy source:
public static void loadRegionSettings(Region region){
  for (  RegionSetting setting : RegionSetting.values()) {
    Object prop=regionConfig.getProperty(mkRegionNode(region.Name,setting.getYaml()));
    if (prop == null)     region.settings.put(setting,setting.getDefault());
 else     region.settings.put(setting,prop);
    regionConfig.setProperty(mkRegionNode(region.Name,setting.getYaml()),region.settings.get(setting));
  }
  region.updateLocation();
}

Fixed version (ground truth):
public static void loadRegionSettings(Region region){
  for (  RegionSetting setting : RegionSetting.values()) {
    Object prop=regionConfig.getProperty(region.Name + "String_Node_Str" + setting.getYaml());
    if (prop == null)     region.settings.put(setting,setting.getDefault());
 else     region.settings.put(setting,prop);
    regionConfig.setProperty(region.Name + "String_Node_Str" + setting.getYaml(),region.settings.get(setting));
  }
  region.updateLocation();
}
Program: 178806
Project: 178806
Buggy source:
public static void saveAll(){
  for (  Map.Entry<String,Region> entry : RegionManager.getRegionMap().entrySet()) {
    Region region=entry.getValue();
    for (    Entry<RegionSetting,Object> setting : region.settings.entrySet())     regionConfig.setProperty(mkRegionNode(setting.getKey().getYaml(),region.Name),setting.getValue());
  }
  if (!regionConfig.save())   Util.severe("String_Node_Str");
  grillConfig.removeProperty("String_Node_Str");
  List<String> list=new ArrayList<String>();
  for (  Grill grill : GrillManager.getGrillList()) {
    Block b=grill.getFirstBlock();
    Location loc=b.getLocation();
    list.add(b.getWorld().getName() + "String_Node_Str" + loc.getX()+ "String_Node_Str"+ loc.getY()+ "String_Node_Str"+ loc.getZ());
  }
  grillConfig.setProperty("String_Node_Str",list);
  if (!grillConfig.save())   Util.severe("String_Node_Str");
  if (!mainConfig.save())   Util.severe("String_Node_Str");
}

Fixed version (ground truth):
public static void saveAll(){
  for (  Map.Entry<String,Region> entry : RegionManager.getRegionMap().entrySet()) {
    Region region=entry.getValue();
    for (    Entry<RegionSetting,Object> setting : region.settings.entrySet())     regionConfig.setProperty(region.Name + "String_Node_Str" + setting.getKey().getYaml(),setting.getValue());
  }
  if (!regionConfig.save())   Util.severe("String_Node_Str");
  grillConfig.removeProperty("String_Node_Str");
  List<String> list=new ArrayList<String>();
  for (  Grill grill : GrillManager.getGrillList()) {
    Block b=grill.getFirstBlock();
    Location loc=b.getLocation();
    list.add(b.getWorld().getName() + "String_Node_Str" + loc.getX()+ "String_Node_Str"+ loc.getY()+ "String_Node_Str"+ loc.getZ());
  }
  grillConfig.setProperty("String_Node_Str",list);
  if (!grillConfig.save())   Util.severe("String_Node_Str");
  if (!mainConfig.save())   Util.severe("String_Node_Str");
}
Program: 178808
Project: 178808
Buggy source:
public static void deleteRegion(String name){
  regionConfig.removeProperty("String_Node_Str" + name);
}

Fixed version (ground truth):
public static void deleteRegion(String name){
  regionConfig.removeProperty(name);
}
Program: 178809
Project: 178809
Buggy source:
private static Configuration getConfigFile(String filename){
  Configuration configfile=null;
  File file=new File(plugin.getDataFolder(),filename);
  if (!file.exists()) {
    try {
      file.createNewFile();
      PrintWriter output=new PrintWriter(file);
      output.println("String_Node_Str");
      output.close();
    }
 catch (    Exception e) {
      Util.severe("String_Node_Str" + filename);
    }
  }
  try {
    configfile=new Configuration(file);
    configfile.load();
    configfile.removeProperty("String_Node_Str");
    configfile.save();
  }
 catch (  Exception e) {
    Util.severe("String_Node_Str" + filename);
  }
  return configfile;
}

Fixed version (ground truth):
private static Configuration getConfigFile(String filename){
  Configuration configfile=null;
  File file=new File(plugin.getDataFolder(),filename);
  try {
    configfile=new Configuration(file);
    configfile.load();
    configfile.removeProperty("String_Node_Str");
    configfile.save();
  }
 catch (  Exception e) {
    Util.severe("String_Node_Str" + filename);
  }
  return configfile;
}
Program: 178810
Project: 178810
Buggy source:
/** 
 * Finds all the base URIs which contain a (prefix) package. The URIs are returned without the actual package, opposed to a call to   {@link #findURIs(String)}
 * @param prefix The package prefix to scan for.
 * @return the base URIs
 */
public Set<URI> findBaseURIs(String prefix){
  Set<URI> result=new HashSet<URI>();
  Set<URI> urIs=findURIs(prefix);
  String path=packagePrefixToPath(prefix);
  for (  URI urI : urIs) {
    String schemeSpecificPart=urI.getSchemeSpecificPart();
    String based=schemeSpecificPart.substring(0,schemeSpecificPart.length() - path.length());
    try {
      result.add(new URI(urI.getScheme(),based,urI.getFragment()));
    }
 catch (    URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
  logger.debug("String_Node_Str",result);
  return result;
}

Fixed version (ground truth):
/** 
 * Finds all the base URIs which contain a (prefix) package. The URIs are returned without the actual package, opposed to a call to   {@link #findURIs(String)}
 * @param prefix The package prefix to scan for.
 * @return the base URIs
 */
public Set<URI> findBaseURIs(String prefix){
  Set<URI> result=new HashSet<URI>();
  Set<URI> urIs=findURIs(prefix);
  String path=packagePrefixToPath(prefix);
  for (  URI urI : urIs) {
    String schemeSpecificPart=urI.getSchemeSpecificPart();
    int l=path.length();
    if (schemeSpecificPart.endsWith("String_Node_Str") && !path.endsWith("String_Node_Str")) {
      l++;
    }
    String based=schemeSpecificPart.substring(0,schemeSpecificPart.length() - l);
    try {
      result.add(new URI(urI.getScheme(),based,urI.getFragment()));
    }
 catch (    URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
  logger.debug("String_Node_Str",result);
  return result;
}
Program: 178811
Project: 178811
Buggy source:
private void createFields(EClass eClass,DescriptorProto.Builder pbMessage){
  for (  EStructuralFeature eFeature : eClass.getEStructuralFeatures()) {
    if (shouldIgnoreFeature(eFeature))     continue;
    FieldDescriptorProto.Builder pbField=pbMessage.addFieldBuilder().setLabel(getFieldLabel(eFeature)).setName(eFeature.getName()).setNumber(pbMessage.getFieldCount());
    registry.find(eFeature.getEType()).mapReference(eFeature.getEType(),pbField);
  }
}

Fixed version (ground truth):
private void createFields(EClass eClass,DescriptorProto.Builder pbMessage){
  for (  EStructuralFeature eFeature : eClass.getEAllStructuralFeatures()) {
    if (shouldIgnoreFeature(eFeature))     continue;
    FieldDescriptorProto.Builder pbField=pbMessage.addFieldBuilder().setLabel(getFieldLabel(eFeature)).setName(eFeature.getName()).setNumber(pbMessage.getFieldCount());
    registry.find(eFeature.getEType()).mapReference(eFeature.getEType(),pbField);
  }
}
Program: 178812
Project: 178812
Buggy source:
@Override protected void doMapReference(EEnum eEnum,FieldDescriptorProto.Builder pbField){
  pbField.setType(FieldDescriptorProto.Type.TYPE_ENUM);
  pbField.setTypeName(naming.getEnum(eEnum));
}

Fixed version (ground truth):
@Override protected void doMapReference(EEnum eEnum,FieldDescriptorProto.Builder pbField){
  pbField.setType(FieldDescriptorProto.Type.TYPE_ENUM);
  pbField.setTypeName(naming.getQualifiedEnum(eEnum));
}
Program: 178813
Project: 178813
Buggy source:
/** 
 */
public int read(InputStream in,int offset,int byteCount) throws IOException {
  if (_bytes.length + offset < byteCount) {
    byte[] newBytes=new byte[byteCount + offset];
    System.arraycopy(_bytes,0,newBytes,0,_bytes.length);
    _bytes=newBytes;
  }
  _size=in.read(_bytes,offset,byteCount);
  return _size;
}

Fixed version (ground truth):
/** 
 */
public int read(InputStream in,int offset,int byteCount) throws IOException {
  if (offset + byteCount > _bytes.length) {
    byte[] newBytes=new byte[byteCount + offset];
    System.arraycopy(_bytes,0,newBytes,0,_bytes.length);
    _bytes=newBytes;
  }
  _size=in.read(_bytes,offset,byteCount);
  return _size;
}
Program: 178814
Project: 178814
Buggy source:
public void onTap(Position cell,boolean editable){
  if (activeInputMethod == cellThenValues && (cell == null || cell.equals(lastMarkedCell))) {
    setUndecided();
  }
 else {
    ifUndecidedUseCellThenValues();
    activeInputMethod.onTap(cell,editable);
  }
}

Fixed version (ground truth):
public void onTap(Position cell,boolean editable){
  if ((activeInputMethod == null || activeInputMethod == cellThenValues) && (cell == null || cell.equals(lastMarkedCell))) {
    setUndecided();
  }
 else {
    ifUndecidedUseCellThenValues();
    activeInputMethod.onTap(cell,editable);
  }
}
Program: 178815
Project: 178815
Buggy source:
public void onTap(Position position,boolean editable){
  if (!editable)   return;
  ValueSet cellValues=target.getCellValues(position);
  if (cellValues.containsAny(values)) {
    cellValues.removeAll(values);
    target.setCellValues(position,cellValues);
  }
 else {
    cellValues.addAll(values);
    target.setCellValues(position,cellValues);
  }
}

Fixed version (ground truth):
public void onTap(Position position,boolean editable){
  if (!editable || values.isEmpty())   return;
  ValueSet cellValues=target.getCellValues(position);
  if (cellValues.containsAny(values)) {
    cellValues.removeAll(values);
    target.setCellValues(position,cellValues);
  }
 else {
    cellValues.addAll(values);
    target.setCellValues(position,cellValues);
  }
}
Program: 178816
Project: 178816
Buggy source:
public CommandStack<?> createFromParcel(Parcel in){
  final int size=in.readInt();
  List<Command<?>> stack=new ArrayList<Command<?>>();
  for (int i=0; i < size; i++) {
    Command<?> command=in.readParcelable(null);
    stack.add(command);
  }
  return new CommandStack(stack);
}

Fixed version (ground truth):
public CommandStack<?> createFromParcel(Parcel in){
  final int size=in.readInt();
  List<Command<?>> stack=new ArrayList<Command<?>>();
  for (int i=0; i < size; i++) {
    Command<?> command=in.readParcelable(CommandStack.class.getClassLoader());
    stack.add(command);
  }
  return new CommandStack(stack);
}
Program: 178817
Project: 178817
Buggy source:
public void testSaveAndRestoreMemento() throws Exception {
  AndokuPuzzle p1=MockPuzzleSource.createPuzzle(0);
  p1.computeSolution();
  p1.setValues(0,1,ValueSet.of(7));
  p1.setValues(0,2,ValueSet.of(6));
  p1.setValues(0,4,ValueSet.of(3,4));
  p1.setValues(0,5,ValueSet.of(8));
  p1.checkForErrors(true);
  assertEquals(2,p1.getRegionErrors().size());
  assertEquals(1,p1.getCellErrors().size());
  Serializable memento=p1.saveToMemento();
  memento=SerializableUtil.roundTrip(memento);
  AndokuPuzzle p2=MockPuzzleSource.createPuzzle(0);
  assertEquals(ValueSet.none(),p2.getValues(0,1));
  assertEquals(ValueSet.none(),p2.getValues(0,2));
  assertEquals(ValueSet.none(),p2.getValues(0,4));
  assertEquals(ValueSet.none(),p2.getValues(0,5));
  assertTrue(p2.getRegionErrors().isEmpty());
  assertTrue(p2.getCellErrors().isEmpty());
  p2.restoreFromMemento(memento);
  assertEquals(ValueSet.of(7),p2.getValues(0,1));
  assertEquals(ValueSet.of(6),p2.getValues(0,2));
  assertEquals(ValueSet.of(3,4),p2.getValues(0,4));
  assertEquals(ValueSet.of(8),p2.getValues(0,5));
  assertEquals(2,p2.getRegionErrors().size());
  assertEquals(1,p2.getCellErrors().size());
  assertEquals(p1.getRegionErrors(),p2.getRegionErrors());
  assertEquals(p1.getCellErrors(),p2.getCellErrors());
}

Fixed version (ground truth):
public void testSaveAndRestoreMemento() throws Exception {
  AndokuPuzzle p1=MockPuzzleSource.createPuzzle(0);
  p1.computeSolution();
  p1.setValues(0,1,ValueSet.of(7));
  p1.setValues(0,2,ValueSet.of(6));
  p1.setValues(0,4,ValueSet.of(3,4));
  p1.setValues(0,5,ValueSet.of(8));
  p1.checkForErrors(true);
  assertEquals(2,p1.getRegionErrors().size());
  assertEquals(1,p1.getCellErrors().size());
  byte[] memento=p1.saveToMemento();
  AndokuPuzzle p2=MockPuzzleSource.createPuzzle(0);
  assertEquals(ValueSet.none(),p2.getValues(0,1));
  assertEquals(ValueSet.none(),p2.getValues(0,2));
  assertEquals(ValueSet.none(),p2.getValues(0,4));
  assertEquals(ValueSet.none(),p2.getValues(0,5));
  assertTrue(p2.getRegionErrors().isEmpty());
  assertTrue(p2.getCellErrors().isEmpty());
  p2.restoreFromMemento(memento);
  assertEquals(ValueSet.of(7),p2.getValues(0,1));
  assertEquals(ValueSet.of(6),p2.getValues(0,2));
  assertEquals(ValueSet.of(3,4),p2.getValues(0,4));
  assertEquals(ValueSet.of(8),p2.getValues(0,5));
  assertEquals(2,p2.getRegionErrors().size());
  assertEquals(1,p2.getCellErrors().size());
  assertEquals(p1.getRegionErrors(),p2.getRegionErrors());
  assertEquals(p1.getCellErrors(),p2.getCellErrors());
}
Program: 178818
Project: 178818
Buggy source:
public boolean loadGame(PuzzleId puzzleId,AndokuPuzzle puzzle,TickTimer timer){
  if (Constants.LOG_V)   Log.v(TAG,"String_Node_Str" + puzzleId + "String_Node_Str");
  SQLiteDatabase db=openHelper.getReadableDatabase();
  String[] columns={COL_PUZZLE,COL_TIMER};
  String selection=COL_SOURCE + "String_Node_Str" + COL_NUMBER+ "String_Node_Str";
  String[] selectionArgs={puzzleId.puzzleSourceId,String.valueOf(puzzleId.number)};
  Cursor cursor=db.query(TABLE_GAMES,columns,selection,selectionArgs,null,null,null);
  try {
    if (!cursor.moveToFirst()) {
      return false;
    }
    Object memento=deserialize(cursor.getBlob(0));
    long time=cursor.getLong(1);
    if (!puzzle.restoreFromMemento(memento)) {
      Log.w(TAG,"String_Node_Str" + puzzleId);
      return false;
    }
    timer.setTime(time);
    return true;
  }
  finally {
    cursor.close();
  }
}

Fixed version (ground truth):
public boolean loadGame(PuzzleId puzzleId,AndokuPuzzle puzzle,TickTimer timer){
  if (Constants.LOG_V)   Log.v(TAG,"String_Node_Str" + puzzleId + "String_Node_Str");
  SQLiteDatabase db=openHelper.getReadableDatabase();
  String[] columns={COL_PUZZLE,COL_TIMER};
  String selection=COL_SOURCE + "String_Node_Str" + COL_NUMBER+ "String_Node_Str";
  String[] selectionArgs={puzzleId.puzzleSourceId,String.valueOf(puzzleId.number)};
  Cursor cursor=db.query(TABLE_GAMES,columns,selection,selectionArgs,null,null,null);
  try {
    if (!cursor.moveToFirst()) {
      return false;
    }
    byte[] memento=cursor.getBlob(0);
    long time=cursor.getLong(1);
    if (!puzzle.restoreFromMemento(memento)) {
      Log.w(TAG,"String_Node_Str" + puzzleId);
      return false;
    }
    timer.setTime(time);
    return true;
  }
  finally {
    cursor.close();
  }
}
Program: 178819
Project: 178819
Buggy source:
public void saveGame(PuzzleId puzzleId,AndokuPuzzle puzzle,TickTimer timer){
  if (Constants.LOG_V)   Log.v(TAG,"String_Node_Str" + puzzleId + "String_Node_Str");
  long now=System.currentTimeMillis();
  SQLiteDatabase db=openHelper.getWritableDatabase();
  db.beginTransaction();
  try {
    String[] columns={COL_ID};
    String selection=COL_SOURCE + "String_Node_Str" + COL_NUMBER+ "String_Node_Str";
    String[] selectionArgs={puzzleId.puzzleSourceId,String.valueOf(puzzleId.number)};
    Cursor cursor=db.query(TABLE_GAMES,columns,selection,selectionArgs,null,null,null);
    long rowId=-1;
    if (cursor.moveToFirst()) {
      rowId=cursor.getLong(0);
    }
    cursor.close();
    ContentValues values=new ContentValues();
    values.put(COL_PUZZLE,serialize(puzzle.saveToMemento()));
    values.put(COL_TIMER,timer.getTime());
    values.put(COL_SOLVED,puzzle.isSolved());
    values.put(COL_MODIFIED_DATE,now);
    if (rowId == -1) {
      values.put(COL_SOURCE,puzzleId.puzzleSourceId);
      values.put(COL_NUMBER,puzzleId.number);
      values.put(COL_TYPE,puzzle.getPuzzleType().ordinal());
      values.put(COL_CREATED_DATE,now);
      long insertedRowId=db.insert(TABLE_GAMES,null,values);
      if (insertedRowId == -1)       return;
    }
 else {
      int updated=db.update(TABLE_GAMES,values,COL_ID + "String_Node_Str",new String[]{String.valueOf(rowId)});
      if (updated == 0)       return;
    }
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}

Fixed version (ground truth):
public void saveGame(PuzzleId puzzleId,AndokuPuzzle puzzle,TickTimer timer){
  if (Constants.LOG_V)   Log.v(TAG,"String_Node_Str" + puzzleId + "String_Node_Str");
  long now=System.currentTimeMillis();
  SQLiteDatabase db=openHelper.getWritableDatabase();
  db.beginTransaction();
  try {
    String[] columns={COL_ID};
    String selection=COL_SOURCE + "String_Node_Str" + COL_NUMBER+ "String_Node_Str";
    String[] selectionArgs={puzzleId.puzzleSourceId,String.valueOf(puzzleId.number)};
    Cursor cursor=db.query(TABLE_GAMES,columns,selection,selectionArgs,null,null,null);
    long rowId=-1;
    if (cursor.moveToFirst()) {
      rowId=cursor.getLong(0);
    }
    cursor.close();
    ContentValues values=new ContentValues();
    values.put(COL_PUZZLE,puzzle.saveToMemento());
    values.put(COL_TIMER,timer.getTime());
    values.put(COL_SOLVED,puzzle.isSolved());
    values.put(COL_MODIFIED_DATE,now);
    if (rowId == -1) {
      values.put(COL_SOURCE,puzzleId.puzzleSourceId);
      values.put(COL_NUMBER,puzzleId.number);
      values.put(COL_TYPE,puzzle.getPuzzleType().ordinal());
      values.put(COL_CREATED_DATE,now);
      long insertedRowId=db.insert(TABLE_GAMES,null,values);
      if (insertedRowId == -1)       return;
    }
 else {
      int updated=db.update(TABLE_GAMES,values,COL_ID + "String_Node_Str",new String[]{String.valueOf(rowId)});
      if (updated == 0)       return;
    }
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}
Program: 178820
Project: 178820
Buggy source:
public String getIconFileName(){
  if (publisher.isPublishHtmlReport()) {
    FilePath r=getWorkspaceReportDir();
    if (exists(r,"String_Node_Str")) {
      return ICON;
    }
  }
  File reportDir=getLastBuildReportDir();
  if (exists(new FilePath(reportDir),"String_Node_Str")) {
    return ICON;
  }
  return null;
}

Fixed version (ground truth):
public String getIconFileName(){
  if (publisher.isPublishHtmlReport()) {
    FilePath r=getWorkspaceReportDir();
    if (exists(r,"String_Node_Str")) {
      return ICON;
    }
  }
  File reportDir=getLastBuildReportDir();
  if (reportDir != null && exists(new FilePath(reportDir),"String_Node_Str")) {
    return ICON;
  }
  return null;
}
Program: 178821
Project: 178821
Buggy source:
/** 
 * Test of getPercentageStr method, of class Ratio.
 */
@Test public void testGetPercentageStr_undefined(){
  Ratio ratio=Ratio.create(1.0f,0.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
  ratio=Ratio.create(1.0f,-5.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
}

Fixed version (ground truth):
/** 
 * Test of getPercentageStr method, of class Ratio.
 */
@Test public void testGetPercentageStr_undefined(){
  Ratio ratio=Ratio.create(1.0f,0.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
  ratio=Ratio.create(1.0f,-50.0f);
  assertEquals("String_Node_Str",ratio.getPercentageStr());
}
Program: 178822
Project: 178822
Buggy source:
/** 
 * Test of getPreviousCloverBuildAction method, of class AbstractClassMetrics.
 */
@Test public void testGetPreviousCloverBuildAction_ActionNull(){
  CloverBuildAction cba=mock(CloverBuildAction.class);
  Run<?,?> r=mock(Run.class);
  when(r.getAction(CloverBuildAction.class)).thenReturn(cba);
  AbstractBuild b=mock(AbstractBuild.class);
  when(b.getPreviousBuild()).thenReturn(r);
  target.setOwner(b);
  assertEquals(cba,target.getPreviousCloverBuildAction());
}

Fixed version (ground truth):
/** 
 * Test of getPreviousCloverBuildAction method, of class AbstractClassMetrics.
 */
@Test public void testGetPreviousCloverBuildAction_ActionNull(){
  CloverBuildAction cba2=null;
  Run prebuild2=mock(Run.class);
  when(prebuild2.getAction(CloverBuildAction.class)).thenReturn(cba2);
  CloverBuildAction cba=null;
  Run prebuild=mock(Run.class);
  when(prebuild.getAction(CloverBuildAction.class)).thenReturn(cba);
  when(prebuild.getPreviousBuild()).thenReturn(prebuild2);
  AbstractBuild b=mock(AbstractBuild.class);
  when(b.getPreviousBuild()).thenReturn(prebuild);
  target.setOwner(b);
  assertEquals(cba2,target.getPreviousCloverBuildAction());
}
Program: 178824
Project: 178824
Buggy source:
public DictTokenizer(AttributeFactory factory,Reader in){
  super(factory,in);
  init();
}

Fixed version (ground truth):
public DictTokenizer(AttributeFactory factory,Reader in){
  super(factory,in);
}
Program: 178825
Project: 178825
Buggy source:
public boolean incrementToken() throws IOException {
  clearAttributes();
  return moveToNextToken();
}

Fixed version (ground truth):
public boolean incrementToken() throws IOException {
  if (reader == null) {
    reader=new CharReader(input);
  }
  clearAttributes();
  return moveToNextToken();
}
Program: 178826
Project: 178826
Buggy source:
final boolean moveToNextToken() throws IOException {
  if (fillAttributes()) {
    return true;
  }
  int i;
  char c;
  Cell cell=dict.root;
  boolean hasWord=false;
  boolean hasPending=false;
  pending.reset();
  for (; ; ) {
    i=reader.read();
    if (i == CharReader.EOF) {
      break;
    }
    c=(char)i;
    cell=cell.child(c);
    if (cell == null) {
      if (hasWord) {
        reader.reset();
        return fillAttributes();
      }
 else {
        cell=dict.root;
        if (hasPending) {
          hasPending=false;
          unknown.append(pending.buffer[0]);
          reader.reset();
          pending.reset();
          continue;
        }
        unknown.append(c);
        reader.mark();
        if (unknown.length() >= MAX_UNKNOWN_WORD_SIZE - 2) {
          return fillAttributes();
        }
      }
    }
 else {
      pending.append(c);
      if (cell.end) {
        matchCell=cell;
        return fillAttributes();
      }
 else       if (cell.wordEnd) {
        hasWord=true;
        matchCell=cell;
        reader.mark();
      }
 else {
        if (!hasPending) {
          hasPending=true;
          reader.mark();
        }
      }
    }
  }
  if (pending.length() > 0) {
    unknown.append(pending);
  }
  return fillAttributes();
}

Fixed version (ground truth):
final boolean moveToNextToken() throws IOException {
  if (fillAttributes()) {
    return true;
  }
  int i;
  char c;
  Cell cell=dict.root;
  boolean hasWord=false;
  boolean hasPending=false;
  pending.reset();
  for (; ; ) {
    i=reader.read();
    if (i == CharReader.EOF) {
      if (hasWord) {
        reader.reset();
        return fillAttributes();
      }
      break;
    }
    c=(char)i;
    cell=cell.child(c);
    if (cell == null) {
      if (hasWord) {
        reader.reset();
        return fillAttributes();
      }
 else {
        cell=dict.root;
        if (hasPending) {
          hasPending=false;
          unknown.append(pending.buffer[0]);
          reader.reset();
          pending.reset();
          continue;
        }
        unknown.append(c);
        reader.mark();
        if (unknown.length() >= MAX_UNKNOWN_WORD_SIZE - 2) {
          return fillAttributes();
        }
      }
    }
 else {
      pending.append(c);
      if (cell.end) {
        matchCell=cell;
        return fillAttributes();
      }
 else       if (cell.wordEnd) {
        hasWord=true;
        matchCell=cell;
        reader.mark();
      }
 else {
        if (!hasPending) {
          hasPending=true;
          reader.mark();
        }
      }
    }
  }
  if (pending.length() > 0) {
    unknown.append(pending);
  }
  return fillAttributes();
}
Program: 178827
Project: 178827
Buggy source:
/** 
 * Constructor for the thread that does zeroconf work
 */
public ZeroconfServiceThread(Context ctx,ArrayList<Messenger> givenClients,boolean givenSendBlacklist){
  super(ctx,givenClients);
  sendBlacklist=givenSendBlacklist;
  setName("String_Node_Str");
  wifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  lock=wifiManager.createMulticastLock("String_Node_Str");
  lock.setReferenceCounted(true);
  lock.acquire();
  updateHashes(sendBlacklist);
  updateData();
  setServiceState(STATE_NONE);
}

Fixed version (ground truth):
/** 
 * Constructor for the thread that does zeroconf work
 */
public ZeroconfServiceThread(Context ctx,ArrayList<Messenger> givenClients,boolean givenSendBlacklist){
  super(ctx,givenClients);
  sendBlacklist=givenSendBlacklist;
  setName("String_Node_Str");
  wifiManager=(WifiManager)context.getSystemService(Context.WIFI_SERVICE);
  lock=wifiManager.createMulticastLock("String_Node_Str");
  lock.setReferenceCounted(true);
  lock.acquire();
  updateHashes(sendBlacklist);
  updateData();
  if (serverThread == null) {
    serverThread=new ZeroconfServerThread(ctx,threadHandler,clients);
    serverThread.setHashes(currentHashes);
    serverThread.setData(currentData);
    serverThread.start();
  }
  setServiceState(STATE_NONE);
}
Program: 178828
Project: 178828
Buggy source:
@Override public void serviceResolved(ServiceEvent ev){
  String additions="String_Node_Str";
  if (ev.getInfo().getInetAddresses() != null && ev.getInfo().getInetAddresses().length > 0) {
    log.debug("String_Node_Str" + ev.getInfo().getInetAddresses().length);
    additions=ev.getInfo().getInetAddresses()[0].getHostAddress();
    log.debug("String_Node_Str" + ev.getInfo().getQualifiedName() + "String_Node_Str"+ ev.getInfo().getPort()+ "String_Node_Str"+ additions);
    String host=additions;
    int port=ev.getInfo().getPort();
    if (!(ev.getInfo().getQualifiedName().equals(zeroconfServiceName + "String_Node_Str" + zeroconfType))) {
      connect(host,port);
    }
  }
}

Fixed version (ground truth):
@Override public void serviceResolved(ServiceEvent ev){
  String additions="String_Node_Str";
  if (ev.getInfo().getInetAddresses() != null && ev.getInfo().getInetAddresses().length > 0) {
    log.debug("String_Node_Str" + ev.getInfo().getInetAddresses().length);
    additions=ev.getInfo().getInetAddresses()[0].getHostAddress();
    log.debug("String_Node_Str" + ev.getInfo().getQualifiedName() + "String_Node_Str"+ ev.getInfo().getPort()+ "String_Node_Str"+ additions);
    String host=additions;
    int port=ev.getInfo().getPort();
    if (!(ev.getInfo().getQualifiedName().equals(zeroconfServiceName + "String_Node_Str" + zeroconfType))) {
      DiscoveredDevice d=new DiscoveredDevice(ev.getName(),host,port);
      discoveredDevices.put(ev.getName(),d);
    }
  }
  if (!discoveredDevices.isEmpty()) {
    Iterator it=discoveredDevices.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs=(Map.Entry)it.next();
      DiscoveredDevice d=(DiscoveredDevice)pairs.getValue();
      connect(d.getHost(),d.getPort());
    }
  }
}
Program: 178829
Project: 178829
Buggy source:
/** 
 * Set the listener for mDNS results
 */
private void setListener(){
  serviceListener=new ServiceListener(){
    @Override public void serviceResolved(    ServiceEvent ev){
      String additions="String_Node_Str";
      if (ev.getInfo().getInetAddresses() != null && ev.getInfo().getInetAddresses().length > 0) {
        log.debug("String_Node_Str" + ev.getInfo().getInetAddresses().length);
        additions=ev.getInfo().getInetAddresses()[0].getHostAddress();
        log.debug("String_Node_Str" + ev.getInfo().getQualifiedName() + "String_Node_Str"+ ev.getInfo().getPort()+ "String_Node_Str"+ additions);
        String host=additions;
        int port=ev.getInfo().getPort();
        if (!(ev.getInfo().getQualifiedName().equals(zeroconfServiceName + "String_Node_Str" + zeroconfType))) {
          connect(host,port);
        }
      }
    }
    @Override public void serviceRemoved(    ServiceEvent ev){
      log.debug("String_Node_Str" + ev.getName());
    }
    @Override public void serviceAdded(    ServiceEvent event){
      jmdns.requestServiceInfo(event.getType(),event.getName(),1);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Set the listener for mDNS results
 */
private void setListener(){
  serviceListener=new ServiceListener(){
    @Override public void serviceResolved(    ServiceEvent ev){
      String additions="String_Node_Str";
      if (ev.getInfo().getInetAddresses() != null && ev.getInfo().getInetAddresses().length > 0) {
        log.debug("String_Node_Str" + ev.getInfo().getInetAddresses().length);
        additions=ev.getInfo().getInetAddresses()[0].getHostAddress();
        log.debug("String_Node_Str" + ev.getInfo().getQualifiedName() + "String_Node_Str"+ ev.getInfo().getPort()+ "String_Node_Str"+ additions);
        String host=additions;
        int port=ev.getInfo().getPort();
        if (!(ev.getInfo().getQualifiedName().equals(zeroconfServiceName + "String_Node_Str" + zeroconfType))) {
          DiscoveredDevice d=new DiscoveredDevice(ev.getName(),host,port);
          discoveredDevices.put(ev.getName(),d);
        }
      }
      if (!discoveredDevices.isEmpty()) {
        Iterator it=discoveredDevices.entrySet().iterator();
        while (it.hasNext()) {
          Map.Entry pairs=(Map.Entry)it.next();
          DiscoveredDevice d=(DiscoveredDevice)pairs.getValue();
          connect(d.getHost(),d.getPort());
        }
      }
    }
    @Override public void serviceRemoved(    ServiceEvent ev){
      log.debug("String_Node_Str" + ev.getName());
      discoveredDevices.remove(ev.getName());
    }
    @Override public void serviceAdded(    ServiceEvent event){
      jmdns.requestServiceInfo(event.getType(),event.getName(),1);
    }
  }
;
}
Program: 178830
Project: 178830
Buggy source:
@Override public void serviceRemoved(ServiceEvent ev){
  log.debug("String_Node_Str" + ev.getName());
}

Fixed version (ground truth):
@Override public void serviceRemoved(ServiceEvent ev){
  log.debug("String_Node_Str" + ev.getName());
  discoveredDevices.remove(ev.getName());
}
Program: 178831
Project: 178831
Buggy source:
@Override public void onCreate(){
  log.debug("String_Node_Str");
  nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
  state=STATE_NONE;
  pairedDevices=bluetoothAdapter.getBondedDevices();
  btFoundFilter=new IntentFilter(BluetoothDevice.ACTION_FOUND);
  btFoundFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
  btFoundFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
  this.registerReceiver(btDiscoveryReceiver,btFoundFilter);
  dbAdapter=new MessagesDbAdapter(this);
  dbAdapter.open();
  showNotification();
  if (serviceThread == null) {
    boolean paired=true;
    serviceThread=new BluetoothServiceThread(paired);
    log.debug("String_Node_Str");
    serviceThread.start();
  }
}

Fixed version (ground truth):
@Override public void onCreate(){
  log.debug("String_Node_Str");
  nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
  state=STATE_NONE;
  Set<BluetoothDevice> tmp=bluetoothAdapter.getBondedDevices();
  for (  BluetoothDevice device : tmp) {
    allDevicesBT.add(device);
  }
  btFoundFilter=new IntentFilter(BluetoothDevice.ACTION_FOUND);
  btFoundFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
  btFoundFilter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
  this.registerReceiver(btDiscoveryReceiver,btFoundFilter);
  dbAdapter=new MessagesDbAdapter(this);
  dbAdapter.open();
  showNotification();
  if (serviceThread == null) {
    boolean paired=true;
    serviceThread=new BluetoothServiceThread(paired);
    log.debug("String_Node_Str");
    serviceThread.start();
  }
}
Program: 178832
Project: 178832
Buggy source:
@Override protected void onPause(){
  super.onPause();
}

Fixed version (ground truth):
@Override protected void onPause(){
  log.debug("String_Node_Str");
  super.onPause();
}
Program: 178833
Project: 178833
Buggy source:
@Override public void onStart(){
  super.onStart();
  dbAdapter=new MessagesDbAdapter(this);
  dbAdapter.open();
  fillListView(VIEW_MODE);
  setupPreferences();
  File dataDir=Environment.getExternalStorageDirectory();
  attachmentsDir=new File(dataDir.getAbsolutePath() + "String_Node_Str");
  attachmentsDir.mkdirs();
  if (bluetoothAdapter != null) {
    if (!bluetoothAdapter.isEnabled()) {
      Intent enableIntent=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
      startActivityForResult(enableIntent,REQUEST_ENABLE_BT);
      toast=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG);
      toast.show();
    }
 else {
    }
  }
  enableBluetoothServicePref=prefs.getBoolean("String_Node_Str",true);
  if (enableBluetoothServicePref) {
    doBindService();
  }
}

Fixed version (ground truth):
@Override public void onStart(){
  log.debug("String_Node_Str");
  super.onStart();
  if (dbAdapter == null) {
    dbAdapter=new MessagesDbAdapter(this);
    dbAdapter.open();
  }
  fillListView(VIEW_MODE);
  setupPreferences();
  if (bluetoothAdapter != null) {
    if (!bluetoothAdapter.isEnabled()) {
      Intent enableIntent=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
      startActivityForResult(enableIntent,REQUEST_ENABLE_BT);
      toast=Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG);
      toast.show();
    }
 else {
    }
  }
  enableBluetoothServicePref=prefs.getBoolean("String_Node_Str",true);
  if (enableBluetoothServicePref) {
    doBindService();
  }
}
Program: 178834
Project: 178834
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  log.verbose("String_Node_Str");
  setContentView(R.layout.message_list);
  registerForContextMenu(getListView());
  log.verbose("String_Node_Str");
  bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
  if (bluetoothAdapter == null) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle icicle){
  super.onCreate(icicle);
  log.verbose("String_Node_Str");
  setContentView(R.layout.message_list);
  registerForContextMenu(getListView());
  bluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
  if (bluetoothAdapter == null) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  }
  File dataDir=Environment.getExternalStorageDirectory();
  attachmentsDir=new File(dataDir.getAbsolutePath() + "String_Node_Str");
  attachmentsDir.mkdirs();
}
Program: 178835
Project: 178835
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
  prefs.unregisterOnSharedPreferenceChangeListener(preferenceChangeListener);
  dbCursor.close();
  dbAdapter.close();
  try {
    if (bound) {
      doUnbindService();
    }
  }
 catch (  Throwable t) {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  log.debug("String_Node_Str");
  super.onDestroy();
  prefs.unregisterOnSharedPreferenceChangeListener(preferenceChangeListener);
  dbCursor.close();
  dbAdapter.close();
  dbAdapter=null;
  try {
    if (bound) {
      doUnbindService();
    }
  }
 catch (  Throwable t) {
    log.debug("String_Node_Str");
  }
}
Program: 178836
Project: 178836
Buggy source:
@Override protected void onResume(){
  super.onResume();
}

Fixed version (ground truth):
@Override protected void onResume(){
  log.debug("String_Node_Str");
  super.onResume();
}
Program: 178838
Project: 178838
Buggy source:
/** 
 * Save our state to the database
 */
private void saveState(){
  String title=titleEditText.getText().toString();
  String message=messageEditText.getText().toString();
  if (attachmentPath == null) {
    dbAdapter.add_new(0,title,message);
  }
 else {
    File file=new File(attachmentPath);
    dbAdapter.add_new(attachmentType,title,message,attachmentPath,file.getName());
  }
}

Fixed version (ground truth):
/** 
 * Save our state to the database
 */
private void saveState(){
  String title=titleEditText.getText().toString();
  String message=messageEditText.getText().toString();
  if (attachmentPath == null) {
    messagesProviderHelper.add_new(0,title,message);
  }
 else {
    File file=new File(attachmentPath);
    messagesProviderHelper.add_new(attachmentType,title,message,attachmentPath,file.getName());
  }
}
Program: 178839
Project: 178839
Buggy source:
/** 
 * Set the state of the connected thread
 * @param state Int that defines the connected thread state
 */
private synchronized void setConnectedState(char newState){
  int iNew=(int)newState;
  int iConnected=(int)connectedState;
  String tmpNewState=Integer.toString(iNew);
  String tmpConnectedState=Integer.toString(iConnected);
  log.debug("String_Node_Str" + tmpConnectedState + "String_Node_Str"+ tmpNewState);
  connectedState=newState;
}

Fixed version (ground truth):
/** 
 * Set the state of the connected thread
 * @param state char that defines the connected thread state
 */
private synchronized void setConnectedState(char newState){
  int iNew=(int)newState;
  int iConnected=(int)connectedState;
  String tmpNewState=Integer.toString(iNew);
  String tmpConnectedState=Integer.toString(iConnected);
  log.debug("String_Node_Str" + tmpConnectedState + "String_Node_Str"+ tmpNewState);
  connectedState=newState;
}
Program: 178840
Project: 178840
Buggy source:
public long add_new(int type,String title,String data,String cellID){
  float now=(float)System.currentTimeMillis();
  ContentValues values=new ContentValues();
  values.put(KEY_SOURCE,IMSI_HASH);
  values.put(KEY_TIME,now);
  values.put(KEY_TYPE,type);
  values.put(KEY_TITLE,title);
  values.put(KEY_DATA,data);
  values.put(KEY_HASH,makeMD5(title + data));
  values.put(KEY_CELLID,cellID);
  values.put(KEY_MINE,1);
  return database.insert(DATABASE_TABLE,null,values);
}

Fixed version (ground truth):
public long add_new(int type,String title,String data,String cellID){
  float now=(float)(System.currentTimeMillis() / 1000);
  ContentValues values=new ContentValues();
  values.put(KEY_SOURCE,IMSI_HASH);
  values.put(KEY_TIME,now);
  values.put(KEY_TYPE,type);
  values.put(KEY_TITLE,title);
  values.put(KEY_DATA,data);
  values.put(KEY_HASH,makeMD5(title + data));
  values.put(KEY_CELLID,cellID);
  values.put(KEY_MINE,1);
  return database.insert(DATABASE_TABLE,null,values);
}
Program: 178841
Project: 178841
Buggy source:
public void initialPopulate(){
  float now=(float)System.currentTimeMillis();
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_new(0,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void initialPopulate(){
  float now=(float)(System.currentTimeMillis() / 1000);
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_received(0,now,"String_Node_Str","String_Node_Str","String_Node_Str");
  add_new(0,"String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 178842
Project: 178842
Buggy source:
/** 
 * Read our messages sent in protobuf format
 */
private void readMessages(){
  try {
    int messageSize=inputStream.readInt();
    byte[] messagesArray=new byte[messageSize];
    inputStream.readFully(messagesArray,0,messageSize);
    FluidNexusProtos.FluidNexusMessages messages=FluidNexusProtos.FluidNexusMessages.parseFrom(messagesArray);
    for (    FluidNexusProtos.FluidNexusMessage message : messages.getMessageList()) {
      log.debug("String_Node_Str" + message.getMessageTitle());
      log.debug("String_Node_Str" + message.getMessageContent());
      log.debug("String_Node_Str" + message.getMessageTimestamp());
      dbAdapter.add_received(0,message.getMessageTimestamp(),message.getMessageTitle(),message.getMessageContent());
    }
    sendNewMessageMsg();
    Message msg=threadHandler.obtainMessage(UPDATE_HASHES);
    threadHandler.sendMessage(msg);
    setConnectedState(STATE_WRITE_SWITCH);
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + e);
    cleanupConnection();
  }
}

Fixed version (ground truth):
/** 
 * Read our messages sent in protobuf format
 */
private void readMessages(){
  try {
    int messageSize=inputStream.readInt();
    byte[] messagesArray=new byte[messageSize];
    inputStream.readFully(messagesArray,0,messageSize);
    FluidNexusProtos.FluidNexusMessages messages=FluidNexusProtos.FluidNexusMessages.parseFrom(messagesArray);
    int count=0;
    for (    FluidNexusProtos.FluidNexusMessage message : messages.getMessageList()) {
      log.debug("String_Node_Str" + message.getMessageTitle());
      log.debug("String_Node_Str" + message.getMessageContent());
      log.debug("String_Node_Str" + message.getMessageTimestamp());
      dbAdapter.add_received(0,message.getMessageTimestamp(),message.getMessageTitle(),message.getMessageContent());
      count+=1;
    }
    if (count > 0) {
      sendNewMessageMsg();
      Message msg=threadHandler.obtainMessage(UPDATE_HASHES);
      threadHandler.sendMessage(msg);
    }
    setConnectedState(STATE_WRITE_SWITCH);
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + e);
    cleanupConnection();
  }
}