nus-yam/ex-repair huggingface dataset:
Program: 5784
Project: 5784
Buggy source:
public String getName(){
  return "String_Node_Str" + name[type];
}

Fixed version (ground truth):
public String getName(int address){
  int reg=address - offset;
  if (reg == 0)   return "String_Node_Str";
  if (reg < 0x10)   return "String_Node_Str" + (reg - 2) / 2;
  if (reg == 0x10)   return "String_Node_Str";
  if (reg < 0x20)   return "String_Node_Str" + (reg - 0x12) / 2;
  return "String_Node_Str" + Utils.hex16(address) + "String_Node_Str";
}
Program: 5785
Project: 5785
Buggy source:
private void resetTIV(){
  if (lastTIV / 2 < noCompare) {
    if (DEBUG) {
      System.out.println(getName() + "String_Node_Str" + lastTIV);
    }
    tcctl[lastTIV / 2]&=~CC_IFG;
    triggerInterrupts();
  }
}

Fixed version (ground truth):
private void resetTIV(){
  if (lastTIV == timerOverflow) {
    interruptPending=false;
    lastTIV=0;
    if (DEBUG) {
      System.out.println(getName() + "String_Node_Str");
    }
    triggerInterrupts();
  }
  if (lastTIV / 2 < noCompare) {
    if (DEBUG) {
      System.out.println(getName() + "String_Node_Str" + lastTIV);
    }
    tcctl[lastTIV / 2]&=~CC_IFG;
    triggerInterrupts();
  }
}
Program: 5786
Project: 5786
Buggy source:
private void updateCaptures(int index,long cycles){
  int low=0;
  int hi=noCompare;
  if (index != -1) {
    low=index;
    hi=index + 1;
  }
  for (int i=0, n=hi; i < n; i++) {
    int divisor=1;
    int frqClk=1;
    if (clockSource == SRC_SMCLK) {
      frqClk=core.smclkFrq / inputDivider;
    }
 else     if (clockSource == SRC_ACLK) {
      frqClk=core.aclkFrq / inputDivider;
    }
    if (captureOn[i]) {
      if (inputSrc[i] == SRC_ACLK) {
        divisor=core.aclkFrq;
      }
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ frqClk+ "String_Node_Str"+ divisor);
      }
      expCapInterval[i]=frqClk / divisor;
      expCompare[i]=(counter + expCapInterval[i]) & 0xffff;
      expCaptureTime[i]=cycles + expCapInterval[i] * cyclesMultiplicator;
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ expCompare[i]);
        System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        System.out.println("String_Node_Str" + captureOn[i]);
      }
    }
  }
}

Fixed version (ground truth):
private void updateCaptures(int index,long cycles){
  int low=0;
  int hi=noCompare;
  if (index != -1) {
    low=index;
    hi=index + 1;
  }
  for (int i=0, n=hi; i < n; i++) {
    int divisor=1;
    int frqClk=1;
    if (clockSource == SRC_SMCLK) {
      frqClk=core.smclkFrq / inputDivider;
    }
 else     if (clockSource == SRC_ACLK) {
      frqClk=core.aclkFrq / inputDivider;
    }
    if (captureOn[i]) {
      if (inputSrc[i] == SRC_ACLK) {
        divisor=core.aclkFrq;
      }
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ frqClk+ "String_Node_Str"+ divisor);
      }
      expCapInterval[i]=frqClk / divisor;
      expCompare[i]=(counter + expCapInterval[i]) & 0xffff;
      expCaptureTime[i]=cycles + (long)(expCapInterval[i] * cyclesMultiplicator);
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ expCompare[i]);
        System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        System.out.println("String_Node_Str" + captureOn[i]);
      }
    }
  }
}
Program: 5787
Project: 5787
Buggy source:
public long ioTick(long cycles){
  for (int i=0, n=noCompare; i < n; i++) {
    if (expCaptureTime[i] != -1 && cycles > expCaptureTime[i]) {
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ cycles+ "String_Node_Str"+ expCaptureTime[i]+ "String_Node_Str"+ Utils.hex16(expCompare[i])+ "String_Node_Str"+ Utils.hex16(updateCounter(cycles)));
      }
      tcctl[i]|=CC_IFG;
      if (captureOn[i]) {
        tccr[i]=expCompare[i];
        expCompare[i]=(expCompare[i] + expCapInterval[i]) & 0xffff;
        expCaptureTime[i]+=expCapInterval[i] * cyclesMultiplicator;
        if (DEBUG) {
          System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        }
      }
 else {
        expCaptureTime[i]=expCaptureTime[i] + 0x10000 * cyclesMultiplicator;
        if (DEBUG) {
          System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        }
      }
      if (DEBUG) {
        System.out.println("String_Node_Str" + Utils.hex16(offset + TCCTL0 + i * 2 + 1));
      }
    }
  }
  triggerInterrupts();
  return 1000 + cycles;
}

Fixed version (ground truth):
public long ioTick(long cycles){
  if (cycles > nextTimerTrigger) {
    interruptPending=true;
    nextTimerTrigger=(long)(nextTimerTrigger + 0x10000 * cyclesMultiplicator);
  }
  for (int i=0, n=noCompare; i < n; i++) {
    if (expCaptureTime[i] != -1 && cycles > expCaptureTime[i]) {
      if (DEBUG) {
        System.out.println(getName() + "String_Node_Str" + i+ "String_Node_Str"+ cycles+ "String_Node_Str"+ expCaptureTime[i]+ "String_Node_Str"+ Utils.hex16(expCompare[i])+ "String_Node_Str"+ Utils.hex16(updateCounter(cycles)));
      }
      tcctl[i]|=CC_IFG;
      if (captureOn[i]) {
        tccr[i]=expCompare[i];
        expCompare[i]=(expCompare[i] + expCapInterval[i]) & 0xffff;
        expCaptureTime[i]+=expCapInterval[i] * cyclesMultiplicator;
        if (DEBUG) {
          System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        }
      }
 else {
        expCaptureTime[i]=expCaptureTime[i] + (long)(0x10000 * cyclesMultiplicator);
        if (DEBUG) {
          System.out.println(getName() + "String_Node_Str" + expCaptureTime[i]);
        }
      }
      if (DEBUG) {
        System.out.println("String_Node_Str" + Utils.hex16(offset + TCCTL0 + i * 2 + 1));
      }
    }
  }
  triggerInterrupts();
  return 1000 + cycles;
}
Program: 5788
Project: 5788
Buggy source:
/** 
 * Creates a new <code>Timer</code> instance.
 */
public Timer(MSP430Core core,int[] srcMap,int[] memory,int offset){
  super(memory,offset);
  this.srcMap=srcMap;
  this.core=core;
  noCompare=(srcMap.length / 4) - 1;
  if (DEBUG) {
    System.out.println("String_Node_Str" + noCompare);
  }
  if (srcMap == TIMER_Ax149) {
    type=TIMER_A;
  }
 else {
    type=TIMER_B;
  }
  reset();
}

Fixed version (ground truth):
/** 
 * Creates a new <code>Timer</code> instance.
 */
public Timer(MSP430Core core,int[] srcMap,int[] memory,int offset){
  super(memory,offset);
  this.srcMap=srcMap;
  this.core=core;
  noCompare=(srcMap.length / 4) - 1;
  if (DEBUG) {
    System.out.println("String_Node_Str" + noCompare);
  }
  if (srcMap == TIMER_Ax149) {
    type=TIMER_A;
    timerOverflow=0x0a;
  }
 else {
    type=TIMER_B;
    timerOverflow=0x0e;
  }
  reset();
}
Program: 5790
Project: 5790
Buggy source:
private int updateCounter(long cycles){
  double divider=1;
  if (clockSource == SRC_ACLK) {
    divider=1.0 * core.smclkFrq / core.aclkFrq;
  }
  divider=divider * inputDivider;
  long cycctr=cycles - counterStart;
switch (mode) {
case CONTIN:
    counter=((int)(cycctr / divider)) & 0xffff;
  break;
case UP:
counter=((int)(cycctr / divider)) % tccr[0];
break;
case UPDWN:
counter=((int)(cycctr / divider)) % (tccr[0] * 2);
if (counter > tccr[0]) {
counter=2 * tccr[0] - counter;
}
}
return counter;
}

Fixed version (ground truth):
private int updateCounter(long cycles){
  double divider=1;
  if (clockSource == SRC_ACLK) {
    divider=1.0 * core.smclkFrq / core.aclkFrq;
  }
  divider=divider * inputDivider;
  long cycctr=cycles - counterStart;
switch (mode) {
case CONTIN:
    counter=((int)(cycctr / divider)) & 0xffff;
  break;
case UP:
counter=((int)(cycctr / divider)) % tccr[0];
break;
case UPDWN:
counter=((int)(cycctr / divider)) % (tccr[0] * 2);
if (counter > tccr[0]) {
counter=2 * tccr[0] - counter;
}
}
if (DEBUG) {
System.out.println(getName() + "String_Node_Str" + cycctr+ "String_Node_Str"+ divider+ "String_Node_Str"+ mode+ "String_Node_Str"+ counter);
}
return counter;
}
Program: 5792
Project: 5792
Buggy source:
public void updateRegs(){
  if (regsLabel != null) {
    for (int i=0, n=16; i < n; i++) {
      regsLabel[i].setText("String_Node_Str" + Utils.hex16(cpu.reg[i]));
    }
  }
}

Fixed version (ground truth):
public void updateRegs(){
  if (regsLabel != null) {
    for (int i=0, n=16; i < n; i++) {
      regsLabel[i].setText("String_Node_Str" + Utils.hex16(cpu.reg[i]));
    }
  }
  repaint();
}
Program: 5793
Project: 5793
Buggy source:
public static void main(String[] args) throws IOException {
  final MSP430 cpu=new MSP430(0);
  cpu.setMonitorExec(true);
  int[] memory=cpu.getMemory();
  if (args[0].endsWith("String_Node_Str")) {
    IHexReader reader=new IHexReader();
    reader.readFile(memory,args[0]);
  }
 else {
    ELF elf=ELF.readELF(args[0]);
    elf.loadPrograms(memory);
    MapTable map=elf.getMap();
    cpu.getDisAsm().setMap(map);
    cpu.setMap(map);
  }
  cpu.reset();
  SkyNode node=new SkyNode(cpu);
  node.gui=new SkyGui(node);
  ControlUI control=new ControlUI(cpu);
  if (args.length > 1) {
    MapTable map=new MapTable(args[1]);
    cpu.getDisAsm().setMap(map);
  }
  cpu.cpuloop();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  final MSP430 cpu=new MSP430(0);
  cpu.setMonitorExec(true);
  ELF elf=null;
  int[] memory=cpu.getMemory();
  if (args[0].endsWith("String_Node_Str")) {
    IHexReader reader=new IHexReader();
    reader.readFile(memory,args[0]);
  }
 else {
    elf=ELF.readELF(args[0]);
    elf.loadPrograms(memory);
    MapTable map=elf.getMap();
    cpu.getDisAsm().setMap(map);
    cpu.setMap(map);
  }
  cpu.reset();
  SkyNode node=new SkyNode(cpu);
  node.gui=new SkyGui(node);
  ControlUI control=new ControlUI(cpu,elf);
  if (args.length > 1) {
    MapTable map=new MapTable(args[1]);
    cpu.getDisAsm().setMap(map);
  }
  cpu.cpuloop();
}
Program: 5794
Project: 5794
Buggy source:
public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  updateCPUPercent();
  if ("String_Node_Str".equals(cmd)) {
    cpu.setDebug(true);
    ((JButton)ae.getSource()).setText("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(cmd)) {
    cpu.setDebug(false);
    ((JButton)ae.getSource()).setText("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(cmd)) {
    new Thread(new Runnable(){
      public void run(){
        cpu.cpuloop();
      }
    }
).start();
    ((JButton)ae.getSource()).setText("String_Node_Str");
    stepAction.setEnabled(false);
  }
 else   if ("String_Node_Str".equals(cmd)) {
    cpu.stop();
    ((JButton)ae.getSource()).setText("String_Node_Str");
    stepAction.setEnabled(true);
  }
 else   if ("String_Node_Str".equals(cmd)) {
    if (cpu.getProfiler() != null) {
      cpu.getProfiler().printProfile();
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
 else   if ("String_Node_Str".equals(cmd)) {
    int pc=cpu.readRegister(cpu.PC);
    if (sourceViewer != null) {
      DebugInfo dbg=elfData.getDebugInfo(pc);
      if (dbg != null) {
        if (sourceViewer != null) {
          sourceViewer.viewFile(dbg.getFile());
          sourceViewer.viewLine(dbg.getLine());
        }
 else {
          System.out.println("String_Node_Str" + dbg.getFile());
          System.out.println("String_Node_Str" + dbg.getLine());
        }
      }
    }
  }
  dui.updateRegs();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  updateCPUPercent();
  if ("String_Node_Str".equals(cmd)) {
    cpu.setDebug(true);
    ((JButton)ae.getSource()).setText("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(cmd)) {
    cpu.setDebug(false);
    ((JButton)ae.getSource()).setText("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(cmd)) {
    new Thread(new Runnable(){
      public void run(){
        cpu.cpuloop();
      }
    }
).start();
    ((JButton)ae.getSource()).setText("String_Node_Str");
    stepAction.setEnabled(false);
  }
 else   if ("String_Node_Str".equals(cmd)) {
    cpu.stop();
    ((JButton)ae.getSource()).setText("String_Node_Str");
    stepAction.setEnabled(true);
  }
 else   if ("String_Node_Str".equals(cmd)) {
    if (cpu.getProfiler() != null) {
      cpu.getProfiler().printProfile();
    }
 else {
      System.out.println("String_Node_Str");
    }
  }
 else   if ("String_Node_Str".equals(cmd)) {
    int pc=cpu.readRegister(cpu.PC);
    if (elfData != null) {
      DebugInfo dbg=elfData.getDebugInfo(pc);
      if (dbg != null) {
        if (sourceViewer != null) {
          sourceViewer.viewFile(dbg.getFile());
          sourceViewer.viewLine(dbg.getLine());
        }
 else {
          System.out.println("String_Node_Str" + dbg.getFile());
          System.out.println("String_Node_Str" + dbg.getLine());
        }
      }
    }
  }
  dui.updateRegs();
}
Program: 5796
Project: 5796
Buggy source:
public static OfficeFinder getFinder(final MsOfficeType contentType){
  OsEnum os=OsEnum.getOS(System.getProperty("String_Node_Str"));
switch (os) {
case WINDOWS_XP:
case WINDOWS_VISTA:
case WINDOWS_SEVEN:
    if (contentType.isMsOfficeCompatible()) {
      return new MsOfficeRegistryHelper();
    }
  return new WindowsOpenOfficeFinder();
case LINUX:
return new WhereisHelper();
case MAC_OSX:
return new MacOsOfficeFinder();
default :
return new WhereisHelper();
}
}

Fixed version (ground truth):
public static OfficeFinder getFinder(final MsOfficeType contentType){
  OsEnum os=OsEnum.getOS(System.getProperty("String_Node_Str"));
switch (os) {
case WINDOWS_XP:
case WINDOWS_VISTA:
case WINDOWS_SEVEN:
case WINDOWS_8:
    if (contentType.isMsOfficeCompatible()) {
      return new MsOfficeRegistryHelper();
    }
  return new WindowsOpenOfficeFinder();
case LINUX:
return new WhereisHelper();
case MAC_OSX:
return new MacOsOfficeFinder();
default :
return new WhereisHelper();
}
}
Program: 5799
Project: 5799
Buggy source:
protected String getPath(RegistryApplicationKey type){
  String clsid=getClsid(type);
  if (clsid != null) {
    String path=RegistryKeyReader.readKey(BASE_KEY_CLSID + clsid + "String_Node_Str");
    if (path == null) {
      path=RegistryKeyReader.readKey(BASE_KEY_64_CLSID + clsid + "String_Node_Str");
    }
    if (path != null) {
      String extractedPath=extractPath(path);
      if (!extractedPath.startsWith("String_Node_Str")) {
        extractedPath='"' + extractedPath + '"';
      }
      return extractedPath;
    }
  }
  return null;
}

Fixed version (ground truth):
protected String getPath(RegistryApplicationKey type){
  String clsid=getClsid(type);
  if (clsid != null) {
    String path=RegistryKeyReader.readKey(BASE_KEY_CLSID + clsid + "String_Node_Str");
    if (path == null) {
      path=RegistryKeyReader.readKey(BASE_KEY_64_CLSID + clsid + "String_Node_Str");
    }
    if (path != null) {
      String extractedPath=extractPath(path).trim();
      if (!extractedPath.startsWith("String_Node_Str")) {
        extractedPath='"' + extractedPath + '"';
      }
      return extractedPath;
    }
  }
  return null;
}
Program: 5800
Project: 5800
Buggy source:
private static MsOfficeType getContentType(String url) throws MalformedURLException {
  String fileName=new URL(url).getFile();
  String contentType=mimeTypes.getContentType(fileName);
  return MsOfficeType.valueOfMimeType(contentType);
}

Fixed version (ground truth):
protected static MsOfficeType getContentType(String url) throws MalformedURLException {
  String fileName=new URL(url).getFile();
  String contentType=mimeTypes.getContentType(fileName.toLowerCase());
  return MsOfficeType.valueOfMimeType(contentType);
}
Program: 5802
Project: 5802
Buggy source:
private void completeView(){
  List<TChar> tChars=currentWord.getChars();
  for (  TChar tChar : tChars) {
    Button charView=new Button(context);
    styleView(charView,tChar.getChar(),20,0xFF000000);
    LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(50,50,1);
    charView.setLayoutParams(layoutParams);
    charView.setBackgroundResource(R.layout.completed_bg);
    charLayout.addView(charView);
    words.removeFirst();
  }
  if (!words.isEmpty()) {
    nextButton.setVisibility(VISIBLE);
    jumbleButton.setVisibility(INVISIBLE);
  }
 else   finishActivity.endGame();
}

Fixed version (ground truth):
private void completeView(){
  List<TChar> tChars=currentWord.getChars();
  for (  TChar tChar : tChars) {
    Button charView=new Button(context);
    styleView(charView,tChar.getChar(),20,0xFF000000);
    LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(50,50,1);
    charView.setLayoutParams(layoutParams);
    charView.setBackgroundResource(R.layout.completed_bg);
    charLayout.addView(charView);
  }
  words.removeFirst();
  if (!words.isEmpty()) {
    nextButton.setVisibility(VISIBLE);
    jumbleButton.setVisibility(INVISIBLE);
  }
 else   finishActivity.endGame();
}
Program: 5805
Project: 5805
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void removeEntity(String name,final Player player,JavaPlugin plugin){
  server.getServer().getScheduler().callSyncMethod(plugin,new Callable(){
    public Object call() throws Exception {
      Location loc=player.getLocation();
      CraftWorld craftWorld=(CraftWorld)player.getWorld();
      CraftPlayer craftPlayer=(CraftPlayer)player;
      double x=loc.getX() + 0.5;
      double y=loc.getY() + 0.5;
      double z=loc.getZ() + 0.5;
      double radius=10;
      List<Entity> entities=new ArrayList();
      AxisAlignedBB bb=AxisAlignedBB.a(x - radius,y - radius,z - radius,x + radius,y + radius,z + radius);
      entities=craftWorld.getHandle().b(craftPlayer.getHandle(),bb);
      for (      Entity o : entities) {
        if (!(o instanceof EntityPlayer)) {
          o.getBukkitEntity().remove();
        }
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void removeEntity(String name,final Player player,BankAccount plugin){
  server.getServer().getScheduler().callSyncMethod(plugin,new Callable(){
    public Object call() throws Exception {
      Location loc=player.getLocation();
      CraftWorld craftWorld=(CraftWorld)player.getWorld();
      CraftPlayer craftPlayer=(CraftPlayer)player;
      double x=loc.getX() + 0.5;
      double y=loc.getY() + 0.5;
      double z=loc.getZ() + 0.5;
      double radius=10;
      List<Entity> entities=new ArrayList();
      AxisAlignedBB bb=AxisAlignedBB.a(x - radius,y - radius,z - radius,x + radius,y + radius,z + radius);
      entities=craftWorld.getHandle().b(craftPlayer.getHandle(),bb);
      for (      Entity o : entities) {
        if (!(o instanceof EntityPlayer)) {
          o.getBukkitEntity().remove();
        }
      }
      return null;
    }
  }
);
}
Program: 5807
Project: 5807
Buggy source:
boolean checkPermission(Player player,PermissionNodes node,boolean extraLookup){
  if (player != null) {
    if (UsePermissions) {
      if (Permissions.has(player,node.getNode())) {
        return true;
      }
    }
    if (UseGroupManager) {
      if (GroupManager.getWorldsHolder().getWorldPermissions(player).has(player,node.getNode())) {
        return true;
      }
    }
    if (UseOP) {
      if (player.isOp()) {
        return true;
      }
    }
    if (node != PermissionNodes.ACCESS && !extraLookup) {
      if (node != PermissionNodes.ADMIN) {
        if (checkPermission(player,PermissionNodes.ADMIN,true)) {
          return true;
        }
      }
      if (node != PermissionNodes.EXTENDED) {
        if (checkPermission(player,PermissionNodes.EXTENDED,true)) {
          return true;
        }
      }
      if (node == PermissionNodes.OPEN || node == PermissionNodes.DEPOSIT || node == PermissionNodes.WITHDRAW) {
        if (checkPermission(player,PermissionNodes.BASIC,true))         return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean checkPermission(Player player,PermissionNodes node,boolean extraLookup){
  if (player != null) {
    if (UsePermissions) {
      if (Permissions.has(player,node.getNode())) {
        return true;
      }
    }
    if (UseGroupManager) {
      if (GroupManager.getWorldsHolder().getWorldPermissions(player).has(player,node.getNode())) {
        return true;
      }
    }
    if (UseOP) {
      if (player.isOp()) {
        return true;
      }
    }
    if (node != PermissionNodes.ACCESS && !extraLookup) {
      if (node != PermissionNodes.ADMIN) {
        if (checkPermission(player,PermissionNodes.ADMIN,true)) {
          return true;
        }
      }
      if (node != PermissionNodes.EXTENDED) {
        if (checkPermission(player,PermissionNodes.EXTENDED,true)) {
          return true;
        }
      }
      if (node == PermissionNodes.OPEN || node == PermissionNodes.DEPOSIT || node == PermissionNodes.WITHDRAW) {
        if (checkPermission(player,PermissionNodes.BASIC,true))         return true;
      }
    }
  }
  return false;
}
Program: 5808
Project: 5808
Buggy source:
/** 
 * Check for a permission
 * @param player - The player
 * @param node - The PermissionNode (dk.earthgame.TAT.BankAccount.System.PermissionNodes)
 * @return boolean - If the player have the permission
 */
public boolean playerPermission(Player player,PermissionNodes node){
  return checkPermission(player,node,false);
}

Fixed version (ground truth):
/** 
 * Check for a permission
 * @param player - The player
 * @param node - The PermissionNode (dk.earthgame.TAT.BankAccount.System.PermissionNodes)
 * @since 0.5
 * @return boolean - If the player have the permission
 */
public boolean playerPermission(Player player,PermissionNodes node){
  return checkPermission(player,node,false);
}
Program: 5809
Project: 5809
Buggy source:
public int dy(){
  return pieceMove.piece.dx(pieceMove.move.rotation);
}

Fixed version (ground truth):
public int dy(){
  return pieceMove.piece.dy(pieceMove.move.rotation);
}
Program: 5810
Project: 5810
Buggy source:
/** 
 * @param fromMovement the position and orientation we are coming from
 * @param movement position and orientation of current piece
 * @param startDrop true if the action "drop piece" has started
 */
private void calculateValidMoves(Movement fromMovement,Movement movement,boolean startDrop){
  while (visitedPieceMoves.isUnvisited(movement) && movement.isPieceInsideBoard()) {
    markAsVisited(fromMovement,movement);
    if (isSlidingOn || !startDrop) {
      calculateValidMoves(movement,movement.rotate(rotationDirection,visitedPieceMoves),startDrop);
      calculateValidMoves(movement,movement.left(visitedPieceMoves),startDrop);
      calculateValidMoves(movement,movement.right(visitedPieceMoves),startDrop);
    }
    if (!isSlidingOn && !startDrop) {
      startDrop=movement.canRotate(rotationDirection,visitedPieceMoves);
    }
    calculateValidMoves(movement,movement.down(visitedPieceMoves),startDrop);
  }
}

Fixed version (ground truth):
/** 
 * Calculate all valid moves on an empty board recursively.
 * @param fromMovement the position and orientation we are coming from
 * @param movement position and orientation of current piece
 * @param startDrop true if the action "drop piece" has started
 */
private void calculateValidMoves(Movement fromMovement,Movement movement,boolean startDrop){
  while (visitedPieceMoves.isUnvisited(movement) && movement.isPieceInsideBoard()) {
    markAsVisited(fromMovement,movement);
    if (isSlidingOn || !startDrop) {
      calculateValidMoves(movement,movement.rotate(rotationDirection,visitedPieceMoves),startDrop);
      calculateValidMoves(movement,movement.left(visitedPieceMoves),startDrop);
      calculateValidMoves(movement,movement.right(visitedPieceMoves),startDrop);
    }
    if (!isSlidingOn && !startDrop) {
      startDrop=movement.canRotate(rotationDirection,visitedPieceMoves);
    }
    calculateValidMoves(movement,movement.down(visitedPieceMoves),startDrop);
  }
}
Program: 5811
Project: 5811
Buggy source:
public StandardGameSettings(int boardWidth,int boardHeight,boolean sliding){
  super(boardWidth,boardHeight,startX(boardWidth,3),-1,sliding);
}

Fixed version (ground truth):
public StandardGameSettings(int boardWidth,int boardHeight,boolean sliding){
  super(boardWidth,boardHeight,startX(boardWidth,3),0,sliding);
}
Program: 5812
Project: 5812
Buggy source:
public boolean isSlidingEnabled(){
  return slidingEnabled;
}

Fixed version (ground truth):
@Override public boolean isSlidingEnabled(){
  return slidingEnabled;
}
Program: 5813
Project: 5813
Buggy source:
@Override protected PieceShape[] shapes(){
  return new PieceShape[]{new PieceShape(new Point(0,0),new Point(1,0),new Point(2,0),new Point(2,1)),new PieceShape(new Point(0,0),new Point(1,1),new Point(0,1),new Point(0,2)),new PieceShape(new Point(0,0),new Point(0,1),new Point(1,1),new Point(2,1)),new PieceShape(new Point(1,0),new Point(1,1),new Point(0,2),new Point(1,2))};
}

Fixed version (ground truth):
@Override protected PieceShape[] shapes(){
  return new PieceShape[]{new PieceShape(new Point(0,0),new Point(1,0),new Point(2,0),new Point(2,1)),new PieceShape(new Point(0,0),new Point(1,0),new Point(0,1),new Point(0,2)),new PieceShape(new Point(0,0),new Point(0,1),new Point(1,1),new Point(2,1)),new PieceShape(new Point(1,0),new Point(1,1),new Point(0,2),new Point(1,2))};
}
Program: 5814
Project: 5814
Buggy source:
private void acceptConnections(){
  while (run) {
    try {
      Socket client=listenerSocket.accept();
      if (client != null) {
        clientHolder.add(new TelnetListener(client,mcserv,this));
        System.out.print("String_Node_Str" + client.getInetAddress().toString());
      }
      for (int i=0; i < clientHolder.size(); i++) {
        TelnetListener thisListener=clientHolder.get(i);
        if (thisListener.isAlive() == false)         clientHolder.remove(i);
      }
    }
 catch (    IOException ex) {
      run=false;
    }
  }
  Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str");
  for (int i=0; i < clientHolder.size(); i++) {
    TelnetListener temp=clientHolder.get(i);
    temp.killClient();
  }
  listenerSocket=null;
  mcserv=null;
  clientHolder.clear();
  clientHolder=null;
  this.setEnabled(false);
}

Fixed version (ground truth):
private void acceptConnections(){
  while (run) {
    try {
      Socket client=listenerSocket.accept();
      if (client != null) {
        clientHolder.add(new TelnetListener(client,this));
        System.out.print("String_Node_Str" + client.getInetAddress().toString());
      }
      for (int i=0; i < clientHolder.size(); i++) {
        TelnetListener thisListener=clientHolder.get(i);
        if (thisListener.isAlive() == false)         clientHolder.remove(i);
      }
    }
 catch (    IOException ex) {
      run=false;
    }
  }
  Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str");
  for (int i=0; i < clientHolder.size(); i++) {
    TelnetListener temp=clientHolder.get(i);
    temp.killClient();
  }
  listenerSocket=null;
  clientHolder.clear();
  clientHolder=null;
  this.setEnabled(false);
}
Program: 5815
Project: 5815
Buggy source:
public void onEnable(){
  try {
    Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
    run=true;
    this.getConfiguration().load();
    testConfig();
    if (this.getConfiguration().getBoolean("String_Node_Str",false))     encryptPasswords();
    port=this.getConfiguration().getInt("String_Node_Str",port);
    try {
      String address=this.getConfiguration().getString("String_Node_Str",null);
      if (address != null)       listenAddress=InetAddress.getByName(address);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + ex.getMessage());
    }
    if (listenAddress != null) {
      listenerSocket=new java.net.ServerSocket(port,10,listenAddress);
    }
 else {
      listenerSocket=new java.net.ServerSocket(port,10);
    }
    clientHolder=new ArrayList<TelnetListener>();
    listenerThread=new Thread(new Runnable(){
      public void run(){
        acceptConnections();
      }
    }
);
    listenerThread.start();
    Field cfield=CraftServer.class.getDeclaredField("String_Node_Str");
    cfield.setAccessible(true);
    mcserv=(MinecraftServer)cfield.get((CraftServer)getServer());
    Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str" + listenerSocket.getInetAddress().getHostAddress() + "String_Node_Str"+ port);
  }
 catch (  Exception ex) {
    Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str" + ex.getMessage());
    this.setEnabled(false);
  }
}

Fixed version (ground truth):
public void onEnable(){
  try {
    Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str" + this.getDescription().getVersion() + "String_Node_Str");
    run=true;
    this.getConfiguration().load();
    testConfig();
    if (this.getConfiguration().getBoolean("String_Node_Str",false))     encryptPasswords();
    port=this.getConfiguration().getInt("String_Node_Str",port);
    try {
      String address=this.getConfiguration().getString("String_Node_Str",null);
      if (address != null)       listenAddress=InetAddress.getByName(address);
    }
 catch (    Exception ex) {
      System.out.println("String_Node_Str" + ex.getMessage());
    }
    if (listenAddress != null) {
      listenerSocket=new java.net.ServerSocket(port,10,listenAddress);
    }
 else {
      listenerSocket=new java.net.ServerSocket(port,10);
    }
    clientHolder=new ArrayList<TelnetListener>();
    listenerThread=new Thread(new Runnable(){
      public void run(){
        acceptConnections();
      }
    }
);
    listenerThread.start();
    Field cfield=CraftServer.class.getDeclaredField("String_Node_Str");
    cfield.setAccessible(true);
    Logger.getLogger("String_Node_Str").log(Level.INFO,"String_Node_Str" + listenerSocket.getInetAddress().getHostAddress() + "String_Node_Str"+ port);
  }
 catch (  Exception ex) {
    Logger.getLogger("String_Node_Str").log(Level.SEVERE,"String_Node_Str" + ex.getMessage());
    this.setEnabled(false);
  }
}
Program: 5816
Project: 5816
Buggy source:
public void sendMessage(String string){
  if (clientSocket.isConnected()) {
    try {
      outstream.write(string + "String_Node_Str");
      outstream.flush();
    }
 catch (    IOException ex) {
    }
  }
}

Fixed version (ground truth):
public void sendMessage(String string){
  if (clientSocket.isConnected()) {
    try {
      string=ChatColor.stripColor(string);
      outstream.write(string + "String_Node_Str");
      outstream.flush();
    }
 catch (    IOException ex) {
    }
  }
}
Program: 5817
Project: 5817
Buggy source:
public TelnetListener(Socket inSock,MinecraftServer imcserv,MCTelnet iparent){
  run=true;
  mcserv=imcserv;
  clientSocket=inSock;
  parent=iparent;
  passRegex=parent.getConfiguration().getString("String_Node_Str",passRegex);
  commandRegex=parent.getConfiguration().getString("String_Node_Str",commandRegex);
  ip=clientSocket.getInetAddress().toString();
  listenThread=new Thread(new Runnable(){
    public void run(){
      mainLoop();
    }
  }
);
  listenThread.start();
}

Fixed version (ground truth):
public TelnetListener(Socket inSock,MCTelnet iparent){
  run=true;
  clientSocket=inSock;
  parent=iparent;
  passRegex=parent.getConfiguration().getString("String_Node_Str",passRegex);
  commandRegex=parent.getConfiguration().getString("String_Node_Str",commandRegex);
  ip=clientSocket.getInetAddress().toString();
  listenThread=new Thread(new Runnable(){
    public void run(){
      mainLoop();
    }
  }
);
  listenThread.start();
}
Program: 5818
Project: 5818
Buggy source:
@Override public void publish(LogRecord record){
  try {
    if (!clientSocket.isClosed()) {
      outstream.write(record.getMessage() + "String_Node_Str");
      outstream.flush();
    }
  }
 catch (  IOException ex) {
  }
}

Fixed version (ground truth):
@Override public void publish(LogRecord record){
  try {
    if (!clientSocket.isClosed()) {
      outstream.write(ChatColor.stripColor(record.getMessage()) + "String_Node_Str");
      outstream.flush();
    }
  }
 catch (  IOException ex) {
  }
}
Program: 5819
Project: 5819
Buggy source:
public boolean isInitialized(Object object){
  if (object instanceof LazyableCollection)   return !((LazyableCollection)object).isInitialized();
  return persistence.isInitialized(object);
}

Fixed version (ground truth):
public boolean isInitialized(Object object){
  return persistence.isInitialized(object);
}
Program: 5825
Project: 5825
Buggy source:
@Override public void onCancelled(CancelledEvent event){
synchronized (this) {
    exception=new InterruptedException("String_Node_Str");
    if (waiting)     notifyAll();
  }
}

Fixed version (ground truth):
@Override public void onCancelled(CancelledEvent event){
  Runnable h=handler.issue(sourceContext,event,info,componentName,operation,tideResponder,this);
synchronized (this) {
    exception=new InterruptedException("String_Node_Str");
    if (waiting)     notifyAll();
 else     sourceContext.callLater(h);
  }
}
Program: 5826
Project: 5826
Buggy source:
@Override public void onFailure(final FailureEvent event){
synchronized (this) {
    exception=new ExecutionException(event.getCause());
    if (waiting)     notifyAll();
  }
}

Fixed version (ground truth):
@Override public void onFailure(final FailureEvent event){
  Runnable h=handler.issue(sourceContext,event,info,componentName,operation,tideResponder,this);
synchronized (this) {
    exception=new ExecutionException(event.getCause());
    if (waiting)     notifyAll();
 else     sourceContext.callLater(h);
  }
}
Program: 5827
Project: 5827
Buggy source:
@Override public void onTimeout(TimeoutEvent event){
synchronized (this) {
    exception=new InterruptedException("String_Node_Str");
    if (waiting)     notifyAll();
  }
}

Fixed version (ground truth):
@Override public void onTimeout(TimeoutEvent event){
  Runnable h=handler.issue(sourceContext,event,info,componentName,operation,tideResponder,this);
synchronized (this) {
    exception=new InterruptedException("String_Node_Str");
    if (waiting)     notifyAll();
 else     sourceContext.callLater(h);
  }
}
Program: 5829
Project: 5829
Buggy source:
public FaultHandler(ServerSession serverSession,Context sourceContext,String componentName,String operation,FaultEvent event,Object info,TideResponder<T> tideResponder,ComponentListener<T> componentResponder){
  this.serverSession=serverSession;
  this.sourceContext=sourceContext;
  this.componentName=componentName;
  this.operation=operation;
  this.event=event;
  this.info=info;
  this.tideResponder=tideResponder;
  this.componentResponder=componentResponder;
}

Fixed version (ground truth):
public FaultHandler(ServerSession serverSession,Context sourceContext,String componentName,String operation,Event event,Object info,TideResponder<T> tideResponder,ComponentListener<T> componentResponder){
  this.serverSession=serverSession;
  this.sourceContext=sourceContext;
  this.componentName=componentName;
  this.operation=operation;
  this.event=event;
  this.info=info;
  this.tideResponder=tideResponder;
  this.componentResponder=componentResponder;
}
Program: 5830
Project: 5830
Buggy source:
public static Object load(String url,final Object controller) throws IOException {
  InputStream fxmlStream=null;
  try {
    fxmlStream=controller.getClass().getResourceAsStream(url);
    FXMLLoader loader=new FXMLLoader();
    loader.setControllerFactory(new Callback<Class<?>,Object>(){
      @Override public Object call(      Class<?> type){
        if (type.isInstance(controller))         return controller;
        try {
          return type.newInstance();
        }
 catch (        Exception e) {
          throw new RuntimeException("String_Node_Str" + type);
        }
      }
    }
);
    return loader.load(fxmlStream);
  }
  finally {
    if (fxmlStream != null) {
      fxmlStream.close();
    }
  }
}

Fixed version (ground truth):
public static Object load(String url,final Object controller) throws IOException {
  InputStream fxmlStream=null;
  try {
    fxmlStream=controller.getClass().getResourceAsStream(url);
    FXMLLoader loader=new FXMLLoader();
    loader.setLocation(controller.getClass().getResource(url));
    loader.setControllerFactory(new Callback<Class<?>,Object>(){
      @Override public Object call(      Class<?> type){
        if (type.isInstance(controller))         return controller;
        try {
          return type.newInstance();
        }
 catch (        Exception e) {
          throw new RuntimeException("String_Node_Str" + type);
        }
      }
    }
);
    return loader.load(fxmlStream);
  }
  finally {
    if (fxmlStream != null) {
      fxmlStream.close();
    }
  }
}
Program: 5831
Project: 5831
Buggy source:
/** 
 * @private Retrives an entity in the cache from its uid
 * @param object an entity
 * @param nullIfAbsent return null if entity not cached in context
 */
public Object getCachedObject(Object object,boolean nullIfAbsent){
  Object entity=null;
  if (object instanceof Identifiable) {
    entity=entitiesByUid.get(object.getClass().getName() + "String_Node_Str" + ((Identifiable)object).getUid());
  }
 else   if (object instanceof EntityRef) {
    entity=entitiesByUid.get(((EntityRef)object).getClassName() + "String_Node_Str" + ((EntityRef)object).getUid());
  }
  if (entity != null)   return entity;
  if (nullIfAbsent)   return null;
  return object;
}

Fixed version (ground truth):
/** 
 * @private Retrives an entity in the cache from its uid
 * @param object an entity
 * @param nullIfAbsent return null if entity not cached in context
 */
public Object getCachedObject(Object object,boolean nullIfAbsent){
  Object entity=null;
  if (object instanceof Identifiable) {
    entity=entitiesByUid.get(object.getClass().getName() + "String_Node_Str" + getUid((Identifiable)object));
  }
 else   if (object instanceof EntityRef) {
    entity=entitiesByUid.get(((EntityRef)object).getClassName() + "String_Node_Str" + ((EntityRef)object).getUid());
  }
  if (entity != null)   return entity;
  if (nullIfAbsent)   return null;
  return object;
}
Program: 5833
Project: 5833
Buggy source:
/** 
 * Subscribe the data topic
 */
public void subscribe(){
  consumer.addMessageListener(new MessageListenerImpl());
  consumer.subscribe(subscriptionListener);
  serverSession.checkWaitForLogout();
}

Fixed version (ground truth):
/** 
 * Subscribe the data topic
 */
public void subscribe(){
  consumer.addMessageListener(messageListener);
  consumer.subscribe(subscriptionListener);
  serverSession.checkWaitForLogout();
}
Program: 5834
Project: 5834
Buggy source:
public void unsubscribe(){
  consumer.unsubscribe(unsubscriptionListener);
  consumer.removeMessageListener(messageListener);
  serverSession.checkWaitForLogout();
}

Fixed version (ground truth):
public void unsubscribe(){
  if (consumer.isSubscribed()) {
    consumer.removeMessageListener(messageListener);
    consumer.unsubscribe(unsubscriptionListener);
    serverSession.checkWaitForLogout();
  }
}
Program: 5835
Project: 5835
Buggy source:
public boolean removeMessageListener(MessageListener listener){
  return listeners.remove(listener);
}

Fixed version (ground truth):
public boolean removeMessageListener(MessageListener listener){
  return listeners.remove(listener) != null;
}
Program: 5839
Project: 5839
Buggy source:
public BooleanProperty dirtyProperty(){
  return dirty;
}

Fixed version (ground truth):
public ReadOnlyBooleanProperty dirtyProperty(){
  return dirty;
}
Program: 5840
Project: 5840
Buggy source:
public void configure(Object instance){
  if (instance instanceof ServerSession)   ((ServerSession)instance).setStatus(serverSessionStatus);
}

Fixed version (ground truth):
@Override public void configure(GraniteConfig graniteConfig){
  graniteConfig.registerClassAlias(PersistentSet.class);
  graniteConfig.registerClassAlias(PersistentBag.class);
  graniteConfig.registerClassAlias(PersistentList.class);
  graniteConfig.registerClassAlias(PersistentMap.class);
}
Program: 5841
Project: 5841
Buggy source:
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  oset.removeListener(listenerWrapper);
}

Fixed version (ground truth):
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  if (listenerWrapper != null)   oset.removeListener(listenerWrapper);
}
Program: 5842
Project: 5842
Buggy source:
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  oset.removeListener(listenerWrapper);
}

Fixed version (ground truth):
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  if (listenerWrapper != null)   oset.removeListener(listenerWrapper);
}
Program: 5843
Project: 5843
Buggy source:
public void removeListener(MapChangeListener<? super K,? super V> listener){
  MapChangeListener<? super K,? super V> listenerWrapper=listenerWrappers.remove(listener);
  omap.removeListener(listenerWrapper);
}

Fixed version (ground truth):
public void removeListener(MapChangeListener<? super K,? super V> listener){
  MapChangeListener<? super K,? super V> listenerWrapper=listenerWrappers.remove(listener);
  if (listenerWrapper != null)   omap.removeListener(listenerWrapper);
}
Program: 5844
Project: 5844
Buggy source:
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  oset.removeListener(listenerWrapper);
}

Fixed version (ground truth):
public void removeListener(ListChangeListener<? super T> listener){
  ListChangeListener<? super T> listenerWrapper=listenerWrappers.remove(listener);
  if (listenerWrapper != null)   oset.removeListener(listenerWrapper);
}
Program: 5845
Project: 5845
Buggy source:
public static Object load(final Context context,String url,Class<?> controllerClass) throws IOException {
  InputStream fxmlStream=null;
  try {
    fxmlStream=controllerClass.getResourceAsStream(url);
    FXMLLoader loader=new FXMLLoader();
    loader.setControllerFactory(new Callback<Class<?>,Object>(){
      @Override public Object call(      Class<?> type){
        return context.byType(type);
      }
    }
);
    loader.getNamespace().put("String_Node_Str",context);
    for (    String name : context.allNames())     loader.getNamespace().put(name,context.byName(name));
    return loader.load(fxmlStream);
  }
  finally {
    if (fxmlStream != null) {
      fxmlStream.close();
    }
  }
}

Fixed version (ground truth):
public static Object load(final Context context,String url,Class<?> controllerClass) throws IOException {
  InputStream fxmlStream=null;
  try {
    fxmlStream=controllerClass.getResourceAsStream(url);
    FXMLLoader loader=new FXMLLoader();
    loader.setControllerFactory(new Callback<Class<?>,Object>(){
      @Override public Object call(      Class<?> type){
        return context.byType(type);
      }
    }
);
    for (    String name : context.allNames())     loader.getNamespace().put(name,context.byName(name));
    return loader.load(fxmlStream);
  }
  finally {
    if (fxmlStream != null) {
      fxmlStream.close();
    }
  }
}
Program: 5846
Project: 5846
Buggy source:
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}

Fixed version (ground truth):
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
  beanFactory.registerSingleton("String_Node_Str",getContext(null));
  beanFactory.registerSingleton("String_Node_Str",getContext(null).getEntityManager());
  beanFactory.registerSingleton("String_Node_Str",getContext(null).getDataManager());
}
Program: 5848
Project: 5848
Buggy source:
public static String doRequestGet(String url,Bundle params){
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    boolean first=true;
    for (    String key : params.keySet()) {
      if (first) {
        first=false;
      }
 else {
        sb.append("String_Node_Str");
      }
      sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
    }
    url=url + "String_Node_Str" + sb.toString();
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpGet httpRequest=new HttpGet(url);
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      String strResult=EntityUtils.toString(httpResponse.getEntity());
      return strResult;
    }
 else {
      LogUtils.logD("String_Node_Str");
      return null;
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
public static String doRequestGet(String url,Bundle params){
  String newUrl=null;
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url).append('?');
    boolean first=true;
    for (    String key : params.keySet()) {
      if (!first) {
        sb.append('&');
      }
 else {
        first=false;
      }
      sb.append(URLEncoder.encode(key)).append('=').append(URLEncoder.encode(params.getString(key)));
    }
    newUrl=sb.toString();
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpGet httpRequest=new HttpGet(newUrl);
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      return EntityUtils.toString(httpResponse.getEntity());
    }
 else {
      LogUtils.logD("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}
Program: 5850
Project: 5850
Buggy source:
public static String doRequestGet(String url,Bundle params){
  String newUrl=null;
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url).append('?');
    boolean first=true;
    for (    String key : params.keySet()) {
      if (!first) {
        sb.append('&');
      }
 else {
        first=false;
      }
      sb.append(URLEncoder.encode(key)).append('=').append(URLEncoder.encode(params.getString(key)));
    }
    newUrl=sb.toString();
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpGet httpRequest=new HttpGet(newUrl);
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      return EntityUtils.toString(httpResponse.getEntity());
    }
 else {
      LogUtils.logD("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public static String doRequestGet(String url,Bundle params){
  String newUrl=null;
  if (params != null) {
    StringBuilder sb=new StringBuilder();
    sb.append(url).append('?');
    boolean first=true;
    for (    String key : params.keySet()) {
      if (!first) {
        sb.append('&');
      }
 else {
        first=false;
      }
      sb.append(URLEncoder.encode(key)).append('=').append(URLEncoder.encode(params.getString(key)));
    }
    newUrl=sb.toString();
  }
  HttpParams httpParameters=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(httpParameters,CONNECTION_TIME_OUT);
  HttpConnectionParams.setSoTimeout(httpParameters,SOCKET_TIME_OUT);
  try {
    HttpGet httpRequest=new HttpGet(newUrl);
    HttpResponse httpResponse=new DefaultHttpClient(httpParameters).execute(httpRequest);
    if (httpResponse.getStatusLine().getStatusCode() == SUCCESS_STATUS) {
      return EntityUtils.toString(httpResponse.getEntity());
    }
 else {
      LogUtils.logD("String_Node_Str");
    }
  }
 catch (  Exception e) {
    LogUtils.logE(e.getMessage());
  }
  return null;
}