nus-yam/ex-repair huggingface dataset:
Program: 57721
Project: 57721
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  handler=new Handler();
  bt_info=((Button)this.findViewById(R.id.bt_info));
  bt_rx=((Button)this.findViewById(R.id.bt_rx));
  bt_tx=((Button)this.findViewById(R.id.bt_tx));
  bt_stop=((Button)this.findViewById(R.id.bt_stop));
  bt_openHackRF=((Button)this.findViewById(R.id.bt_openHackRF));
  et_sampRate=(EditText)this.findViewById(R.id.et_sampRate);
  et_freq=(EditText)this.findViewById(R.id.et_freq);
  et_filename=(EditText)this.findViewById(R.id.et_filename);
  sb_vgaGain=(SeekBar)this.findViewById(R.id.sb_vgaGain);
  sb_lnaGain=(SeekBar)this.findViewById(R.id.sb_lnaGain);
  cb_amp=(CheckBox)this.findViewById(R.id.cb_amp);
  cb_antenna=(CheckBox)this.findViewById(R.id.cb_antenna);
  tv_output=(TextView)findViewById(R.id.tv_output);
  tv_output.setMovementMethod(new ScrollingMovementMethod());
  this.toggleButtonsEnabledIfHackrfReady(false);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  handler=new Handler();
  bt_info=((Button)this.findViewById(R.id.bt_info));
  bt_rx=((Button)this.findViewById(R.id.bt_rx));
  bt_tx=((Button)this.findViewById(R.id.bt_tx));
  bt_stop=((Button)this.findViewById(R.id.bt_stop));
  bt_openHackRF=((Button)this.findViewById(R.id.bt_openHackRF));
  et_sampRate=(EditText)this.findViewById(R.id.et_sampRate);
  et_freq=(EditText)this.findViewById(R.id.et_freq);
  et_filename=(EditText)this.findViewById(R.id.et_filename);
  sb_vgaGain=(SeekBar)this.findViewById(R.id.sb_vgaGain);
  sb_lnaGain=(SeekBar)this.findViewById(R.id.sb_lnaGain);
  cb_amp=(CheckBox)this.findViewById(R.id.cb_amp);
  cb_antenna=(CheckBox)this.findViewById(R.id.cb_antenna);
  tv_output=(TextView)findViewById(R.id.tv_output);
  tv_output.setMovementMethod(new ScrollingMovementMethod());
  this.toggleButtonsEnabledIfHackrfReady(false);
  String version="String_Node_Str";
  try {
    version=getPackageManager().getPackageInfo(getPackageName(),0).versionName;
  }
 catch (  NameNotFoundException e) {
  }
  this.tv_output.setText("String_Node_Str" + version + "String_Node_Str");
}
Program: 57722
Project: 57722
Buggy source:
/** 
 * Will read the values from the GUI elements into the corresponding variables
 */
public void readGuiElements(){
  sampRate=Integer.valueOf(et_sampRate.getText().toString());
  frequency=Long.valueOf(et_freq.getText().toString());
  filename=et_filename.getText().toString();
  vgaGain=sb_vgaGain.getProgress();
  lnaGain=sb_vgaGain.getProgress();
  amp=cb_amp.isChecked();
  antennaPower=cb_antenna.isChecked();
}

Fixed version (ground truth):
/** 
 * Will read the values from the GUI elements into the corresponding variables
 */
public void readGuiElements(){
  sampRate=Integer.valueOf(et_sampRate.getText().toString());
  frequency=Long.valueOf(et_freq.getText().toString());
  filename=et_filename.getText().toString();
  vgaGain=sb_vgaGain.getProgress();
  lnaGain=sb_lnaGain.getProgress();
  amp=cb_amp.isChecked();
  antennaPower=cb_antenna.isChecked();
}
Program: 57723
Project: 57723
Buggy source:
/** 
 * @param items List that contains the items to show
 * @param builder Builder that create the Renderers
 */
public RendererAdapter(List<Renderable> items,RendererBuilder builder){
  this.items=items;
  if (items == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.builder=builder;
  if (builder == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param items List that contains the items to show
 * @param builder Builder that create the Renderers
 */
public RendererAdapter(List<? extends Renderable> items,RendererBuilder builder){
  this.items=(List<Renderable>)items;
  if (items == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.builder=builder;
  if (builder == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 57724
Project: 57724
Buggy source:
private Solution solve(float initial,float velocity){
  float cmk=c * c - 4 * m * k;
  if (cmk >= 0) {
    final float r1=(-c - (float)Math.sqrt(cmk)) / (2 * m);
    final float r2=(-c + (float)Math.sqrt(cmk)) / (2 * m);
    final float c2=(velocity - r1 * initial) / (r2 - r1);
    final float c1=initial - c2;
    return new Solution(){
      @Override public float x(      float t){
        return (float)(c1 * Math.pow(Math.E,r1 * t) + c2 * Math.pow(Math.E,r2 * t));
      }
      @Override public float dx(      float t){
        return (float)(c1 * r1 * Math.pow(Math.E,r1 * t) + c2 * r2 * Math.pow(Math.E,r2 * t));
      }
    }
;
  }
 else {
    final float w=(float)Math.sqrt(4 * m * k - c * c) / (2 * m);
    final float r=-(c / 2 * m);
    final float c1=initial;
    final float c2=(velocity - r * initial) / w;
    return new Solution(){
      @Override public float x(      float t){
        return (float)(Math.pow(Math.E,r * t) * (c1 * Math.cos(w * t) + c2 * Math.sin(w * t)));
      }
      @Override public float dx(      float t){
        float power=(float)Math.pow(Math.E,r * t);
        float cos=(float)Math.cos(w * t);
        float sin=(float)Math.sin(w * t);
        return power * (c2 * w * cos - c1 * w * sin) + r * power * (c2 * sin + c1 * cos);
      }
    }
;
  }
}

Fixed version (ground truth):
private Solution solve(float initial,float velocity){
  float cmk=c * c - 4 * m * k;
  if (cmk == 0) {
    final float r=-c / (2 * m);
    final float c1=initial;
    final float c2=velocity / (r * initial);
    return new Solution(){
      @Override public float x(      float t){
        return (float)((c1 + c2 * t) * Math.pow(Math.E,r * t));
      }
      @Override public float dx(      float t){
        float power=(float)Math.pow(Math.E,r * t);
        return (float)(r * (c1 + c2 * t) * power + c2 * power);
      }
    }
;
  }
 else   if (cmk > 0) {
    final float r1=(-c - (float)Math.sqrt(cmk)) / (2 * m);
    final float r2=(-c + (float)Math.sqrt(cmk)) / (2 * m);
    final float c2=(velocity - r1 * initial) / (r2 - r1);
    final float c1=initial - c2;
    return new Solution(){
      @Override public float x(      float t){
        return (float)(c1 * Math.pow(Math.E,r1 * t) + c2 * Math.pow(Math.E,r2 * t));
      }
      @Override public float dx(      float t){
        return (float)(c1 * r1 * Math.pow(Math.E,r1 * t) + c2 * r2 * Math.pow(Math.E,r2 * t));
      }
    }
;
  }
 else {
    final float w=(float)Math.sqrt(4 * m * k - c * c) / (2 * m);
    final float r=-(c / 2 * m);
    final float c1=initial;
    final float c2=(velocity - r * initial) / w;
    return new Solution(){
      @Override public float x(      float t){
        return (float)(Math.pow(Math.E,r * t) * (c1 * Math.cos(w * t) + c2 * Math.sin(w * t)));
      }
      @Override public float dx(      float t){
        float power=(float)Math.pow(Math.E,r * t);
        float cos=(float)Math.cos(w * t);
        float sin=(float)Math.sin(w * t);
        return power * (c2 * w * cos - c1 * w * sin) + r * power * (c2 * sin + c1 * cos);
      }
    }
;
  }
}
Program: 57725
Project: 57725
Buggy source:
public static void info(String header,Object... msg){
  ArrayList<Object> list=new ArrayList<Object>();
  for (  Object object : msg) {
    if (object.getClass() == ArrayList.class) {
      ArrayList<Object> subList=(ArrayList<Object>)object;
      for (      Object subObject : subList) {
        list.add(subObject);
      }
    }
 else {
      list.add(object);
    }
  }
  msg=list.toArray();
  if (debugging == true) {
    String dText="String_Node_Str";
    if (header != null && header != "String_Node_Str") {
      dText+="String_Node_Str" + header.toUpperCase() + "String_Node_Str";
    }
    for (int i=0; i < msg.length; i++) {
      if (i != msg.length - 1) {
        dText+=msg[i] + "String_Node_Str";
      }
 else {
        dText+=msg[i];
        if (header != null && header != "String_Node_Str") {
          dText+="String_Node_Str";
        }
      }
    }
    System.out.println(dText);
  }
  if (logging == true) {
    String lText="String_Node_Str";
    if (header != null && header != "String_Node_Str") {
      lText+=header.toUpperCase();
    }
    for (int i=0; i < msg.length; i++) {
      if (i != msg.length - 1) {
        lText+="String_Node_Str" + msg[i];
      }
 else {
        lText+="String_Node_Str" + msg[i] + "String_Node_Str";
      }
    }
    logger.log(Level.INFO,lText);
  }
}

Fixed version (ground truth):
public static void info(String header,Object... msg){
  ArrayList<Object> list=new ArrayList<Object>();
  for (  Object object : msg) {
    if (object.getClass() == ArrayList.class) {
      ArrayList<Object> subList=(ArrayList<Object>)object;
      for (      Object subObject : subList) {
        list.add(subObject);
      }
    }
 else {
      list.add(object);
    }
  }
  msg=list.toArray();
  if (debugging == true) {
    String dText="String_Node_Str";
    if (header != null && header != "String_Node_Str") {
      dText+="String_Node_Str" + header.toUpperCase() + "String_Node_Str";
      if (msg.length == 0) {
        dText+="String_Node_Str";
      }
    }
    for (int i=0; i < msg.length; i++) {
      if (i != msg.length - 1) {
        dText+=msg[i] + "String_Node_Str";
      }
 else {
        dText+=msg[i];
        if (header != null && header != "String_Node_Str") {
          dText+="String_Node_Str";
        }
      }
    }
    System.out.println(dText);
  }
  if (logging == true) {
    String lText="String_Node_Str";
    if (header != null && header != "String_Node_Str") {
      lText+=header.toUpperCase();
      if (msg.length == 0) {
        lText+="String_Node_Str";
      }
    }
    for (int i=0; i < msg.length; i++) {
      if (i != msg.length - 1) {
        lText+="String_Node_Str" + msg[i];
      }
 else {
        lText+="String_Node_Str" + msg[i] + "String_Node_Str";
      }
    }
    logger.log(Level.INFO,lText);
  }
}
Program: 57726
Project: 57726
Buggy source:
public void startImmersiveProcess() throws Exception {
  Main.ui.button_Off.setEnabled(false);
  Main.ui.button_On.setEnabled(false);
  Main.ui.button_Stop.setEnabled(true);
  Main.ui.button_Start.setEnabled(false);
  Main.ui.button_Once.setEnabled(false);
  for (  HLight light : HBridge.lights) {
    light.storeLightColor();
  }
  captureLoop=new Timer();
  TimerTask task=new TimerTask(){
    public void run(){
      try {
        ImmersiveProcess.execute();
      }
 catch (      Exception e) {
        Debug.exception(e);
      }
    }
  }
;
  captureLoop.scheduleAtFixedRate(task,0,300);
}

Fixed version (ground truth):
public void startImmersiveProcess() throws Exception {
  Main.ui.button_Off.setEnabled(false);
  Main.ui.button_On.setEnabled(false);
  Main.ui.button_Stop.setEnabled(true);
  Main.ui.button_Start.setEnabled(false);
  Main.ui.button_Once.setEnabled(false);
  immersiveProcessIsActive=true;
  for (  HLight light : HBridge.lights) {
    light.storeLightColor();
  }
  captureLoop=new Timer();
  TimerTask task=new TimerTask(){
    public void run(){
      try {
        ImmersiveProcess.execute();
      }
 catch (      Exception e) {
        Debug.exception(e);
      }
    }
  }
;
  captureLoop.scheduleAtFixedRate(task,0,300);
}
Program: 57727
Project: 57727
Buggy source:
public void stopImmersiveProcess() throws Exception {
  captureLoop.cancel();
  captureLoop.purge();
  Main.ui.setupOnOffButton();
  Main.ui.button_Stop.setEnabled(false);
  Main.ui.button_Start.setEnabled(true);
  Main.ui.button_Once.setEnabled(true);
  Thread.sleep(250);
  ImmersiveProcess.setStandbyOutput();
  if (Settings.getBoolean("String_Node_Str")) {
    Thread.sleep(750);
    for (    HLight light : HBridge.lights) {
      light.restoreLightColor();
    }
  }
}

Fixed version (ground truth):
public void stopImmersiveProcess() throws Exception {
  captureLoop.cancel();
  captureLoop.purge();
  immersiveProcessIsActive=false;
  Main.ui.setupOnOffButton();
  Main.ui.button_Stop.setEnabled(false);
  Main.ui.button_Start.setEnabled(true);
  Main.ui.button_Once.setEnabled(true);
  Thread.sleep(250);
  ImmersiveProcess.setStandbyOutput();
  if (Settings.getBoolean("String_Node_Str")) {
    Thread.sleep(750);
    for (    HLight light : HBridge.lights) {
      light.restoreLightColor();
    }
  }
}
Program: 57728
Project: 57728
Buggy source:
public void setupOnOffButton() throws Exception {
  boolean lightOn=false;
  boolean lightOff=false;
  for (  HLight light : HBridge.lights) {
    if (light.isOn() && Settings.Light.getActive(light.uniqueid)) {
      lightOn=true;
    }
 else     if (!light.isOn() && Settings.Light.getActive(light.uniqueid)) {
      lightOff=true;
    }
  }
  if (lightOn && lightOff) {
    button_On.setEnabled(true);
    button_Off.setEnabled(true);
  }
 else   if (lightOn) {
    button_On.setEnabled(false);
    button_Off.setEnabled(true);
  }
 else   if (lightOff) {
    button_On.setEnabled(true);
    button_Off.setEnabled(false);
  }
}

Fixed version (ground truth):
public void setupOnOffButton() throws Exception {
  if (!Main.hueControl.immersiveProcessIsActive) {
    boolean lightOn=false;
    boolean lightOff=false;
    for (    HLight light : HBridge.lights) {
      if (light.isOn() && Settings.Light.getActive(light.uniqueid)) {
        lightOn=true;
      }
 else       if (!light.isOn() && Settings.Light.getActive(light.uniqueid)) {
        lightOff=true;
      }
    }
    if (lightOn && lightOff) {
      button_On.setEnabled(true);
      button_Off.setEnabled(true);
    }
 else     if (lightOn) {
      button_On.setEnabled(false);
      button_Off.setEnabled(true);
    }
 else     if (lightOff) {
      button_On.setEnabled(true);
      button_Off.setEnabled(false);
    }
  }
}
Program: 57729
Project: 57729
Buggy source:
private static void fastConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username+ "String_Node_Str");
  if (HRequest.responseCheck(response) == "String_Node_Str") {
    Debug.info(null,"String_Node_Str");
    debug();
    getLights();
    Main.ui.loadMainInterface();
  }
 else {
    Debug.info(null,"String_Node_Str");
    newConnect();
  }
}

Fixed version (ground truth):
private static void fastConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username);
  if (HRequest.responseCheck(response) == "String_Node_Str") {
    Debug.info(null,"String_Node_Str");
    debug();
    getLights();
    Main.ui.loadMainInterface();
  }
 else {
    Debug.info(null,"String_Node_Str");
    newConnect();
  }
}
Program: 57730
Project: 57730
Buggy source:
public static void debug() throws Exception {
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username+ "String_Node_Str");
  Debug.info("String_Node_Str","String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + "String_Node_Str","String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString());
}

Fixed version (ground truth):
public static void debug() throws Exception {
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username+ "String_Node_Str");
  Debug.info("String_Node_Str","String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString(),"String_Node_Str" + response.get("String_Node_Str").getAsString());
}
Program: 57731
Project: 57731
Buggy source:
private static void fastConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username+ "String_Node_Str");
  if (HRequest.responseCheck(response) == "String_Node_Str") {
    name=response.get("String_Node_Str").getAsString();
    macaddress=response.get("String_Node_Str").getAsString();
    Debug.info(null,"String_Node_Str");
    debug();
    getLights();
    Main.ui.loadMainInterface();
  }
 else {
    newConnect();
  }
}

Fixed version (ground truth):
private static void fastConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  JsonObject response=HRequest.GET("String_Node_Str" + internalipaddress + "String_Node_Str"+ username+ "String_Node_Str");
  if (HRequest.responseCheck(response) == "String_Node_Str") {
    Debug.info(null,"String_Node_Str");
    debug();
    getLights();
    Main.ui.loadMainInterface();
  }
 else {
    newConnect();
  }
}
Program: 57732
Project: 57732
Buggy source:
private static void newConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  Main.ui.loadConnectionInterface();
  Main.ui.setConnectState(1);
  final Timer timer=new Timer();
  TimerTask addUserLoop=new TimerTask(){
    int tries=0;
    public void run(){
      try {
        JsonObject response=HRequest.GET("String_Node_Str");
        if (response != null) {
          timer.cancel();
          timer.purge();
          name=response.get("String_Node_Str").getAsString();
          internalipaddress=response.get("String_Node_Str").getAsString();
          macaddress=response.get("String_Node_Str").getAsString();
          Settings.Bridge.setInternalipaddress(internalipaddress);
          login();
        }
      }
 catch (      Exception e) {
        Debug.exception(e);
      }
      if (tries > 6) {
        try {
          timer.cancel();
          timer.purge();
          Main.ui.setConnectState(4);
          Debug.info(null,"String_Node_Str");
        }
 catch (        Exception e) {
          Debug.exception(e);
        }
      }
      tries++;
    }
  }
;
  timer.scheduleAtFixedRate(addUserLoop,0,1500);
}

Fixed version (ground truth):
private static void newConnect() throws Exception {
  Debug.info(null,"String_Node_Str");
  Main.ui.loadConnectionInterface();
  Main.ui.setConnectState(1);
  final Timer timer=new Timer();
  TimerTask addUserLoop=new TimerTask(){
    int tries=0;
    public void run(){
      try {
        JsonObject response=HRequest.GET("String_Node_Str");
        if (response != null) {
          timer.cancel();
          timer.purge();
          internalipaddress=response.get("String_Node_Str").getAsString();
          Settings.Bridge.setInternalipaddress(internalipaddress);
          login();
        }
      }
 catch (      Exception e) {
        Debug.exception(e);
      }
      if (tries > 6) {
        try {
          timer.cancel();
          timer.purge();
          Main.ui.setConnectState(4);
          Debug.info(null,"String_Node_Str");
        }
 catch (        Exception e) {
          Debug.exception(e);
        }
      }
      tries++;
    }
  }
;
  timer.scheduleAtFixedRate(addUserLoop,0,1500);
}
Program: 57733
Project: 57733
Buggy source:
@Override public void onClick(View view){
  if (view == buttonJiami) {
    String mingwen=editMing.getText().toString();
    if (mingwen == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=mingwen.getBytes();
    String miwen="String_Node_Str";
    try {
      miwen=base64.encryptBASE64(mingData);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    editMi.setText(miwen);
  }
 else   if (view == buttonJiemi) {
    String miwen=editMi.getText().toString();
    if (miwen == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=null;
    try {
      mingData=base64.decryptBASE64(miwen);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    String mingwen=new String(mingData);
    editMing.setText(mingwen);
  }
}

Fixed version (ground truth):
@Override public void onClick(View view){
  if (view == buttonJiami) {
    String mingwen=editMing.getText().toString();
    if (mingwen.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=mingwen.getBytes();
    String miwen="String_Node_Str";
    try {
      miwen=base64.encryptBASE64(mingData);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    editMi.setText(miwen);
  }
 else   if (view == buttonJiemi) {
    String miwen=editMi.getText().toString();
    if (miwen.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=null;
    try {
      mingData=base64.decryptBASE64(miwen);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    String mingwen=new String(mingData);
    editMing.setText(mingwen);
  }
}
Program: 57734
Project: 57734
Buggy source:
@Override public void onClick(View view){
  if (view == jiamiButton) {
    String inputStr=mingEdit.getText().toString();
    if (inputStr == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    String inputKey=miyaoEdit.getText().toString();
    if (inputKey == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] inputData=inputStr.getBytes();
    byte[] outputData=new byte[0];
    try {
      outputData=hmac.encryptHMAC(inputData,inputKey,HmacMthod);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    BigInteger hmacData=new BigInteger(1,outputData);
    miEdit.setText(hmacData.toString(16));
  }
}

Fixed version (ground truth):
@Override public void onClick(View view){
  if (view == jiamiButton) {
    String inputStr=mingEdit.getText().toString();
    if (inputStr.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    String inputKey=miyaoEdit.getText().toString();
    if (inputKey.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] inputData=inputStr.getBytes();
    byte[] outputData=new byte[0];
    try {
      outputData=hmac.encryptHMAC(inputData,inputKey,HmacMthod);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    BigInteger hmacData=new BigInteger(1,outputData);
    miEdit.setText(hmacData.toString(16));
  }
}
Program: 57735
Project: 57735
Buggy source:
@Override public void onClick(View view){
  if (view == encryptButton) {
    String mingwen=mingEdit.getText().toString();
    if (mingwen == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=mingwen.getBytes();
    BigInteger md5Data=null;
    try {
      md5Data=new BigInteger(1,md5.encryptMD5(mingData));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    String md5Str=md5Data.toString(16);
    if (md5Str.length() < 32) {
      md5Str=0 + md5Str;
    }
    miEdit.setText(md5Str);
  }
}

Fixed version (ground truth):
@Override public void onClick(View view){
  if (view == encryptButton) {
    String mingwen=mingEdit.getText().toString();
    if (mingwen.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] mingData=mingwen.getBytes();
    BigInteger md5Data=null;
    try {
      md5Data=new BigInteger(1,md5.encryptMD5(mingData));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    String md5Str=md5Data.toString(16);
    if (md5Str.length() < 32) {
      md5Str=0 + md5Str;
    }
    miEdit.setText(md5Str);
  }
}
Program: 57737
Project: 57737
Buggy source:
public void onSectionAttached(int number){
switch (number) {
case 1:
    mTitle=getString(R.string.title_section1);
  break;
case 2:
mTitle=getString(R.string.title_section2);
break;
case 3:
mTitle=getString(R.string.title_section3);
break;
case 4:
mTitle=getString(R.string.title_section5);
break;
case 5:
mTitle=getString(R.string.title_section6);
break;
case 6:
mTitle=getString(R.string.title_section7);
break;
case 7:
mTitle=getString(R.string.title_section8);
break;
case 8:
mTitle=getString(R.string.title_section9);
break;
case 9:
mTitle=getString(R.string.title_section11);
break;
case 10:
mTitle=getString(R.string.title_section12);
break;
case 11:
mTitle=getString(R.string.title_section13);
break;
}
}

Fixed version (ground truth):
public void onSectionAttached(int number){
switch (number) {
case 1:
    mTitle=getString(R.string.title_section1);
  break;
case 2:
mTitle=getString(R.string.title_section2);
break;
case 3:
mTitle=getString(R.string.title_section3);
break;
case 4:
mTitle=getString(R.string.title_section5);
break;
case 5:
mTitle=getString(R.string.title_section6);
break;
case 6:
mTitle=getString(R.string.title_section7);
break;
case 7:
mTitle=getString(R.string.title_section8);
break;
case 8:
mTitle=getString(R.string.title_section9);
break;
case 9:
mTitle=getString(R.string.title_section11);
break;
case 10:
mTitle=getString(R.string.title_section12);
break;
case 11:
mTitle=getString(R.string.title_section13);
break;
case 12:
mTitle="String_Node_Str";
break;
}
}
Program: 57738
Project: 57738
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mDrawerListView=(ListView)inflater.inflate(R.layout.fragment_navigation_drawer,container,false);
  mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectItem(position);
    }
  }
);
  mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar().getThemedContext(),android.R.layout.simple_list_item_activated_1,android.R.id.text1,new String[]{getString(R.string.title_section1),getString(R.string.title_section2),getString(R.string.title_section3),getString(R.string.title_section5),getString(R.string.title_section6),getString(R.string.title_section7),getString(R.string.title_section8),getString(R.string.title_section9),getString(R.string.title_section11),getString(R.string.title_section12),getString(R.string.title_section13)}));
  mDrawerListView.setItemChecked(mCurrentSelectedPosition,true);
  return mDrawerListView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mDrawerListView=(ListView)inflater.inflate(R.layout.fragment_navigation_drawer,container,false);
  mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      selectItem(position);
    }
  }
);
  mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar().getThemedContext(),android.R.layout.simple_list_item_activated_1,android.R.id.text1,new String[]{getString(R.string.title_section1),getString(R.string.title_section2),getString(R.string.title_section3),getString(R.string.title_section5),getString(R.string.title_section6),getString(R.string.title_section7),getString(R.string.title_section8),getString(R.string.title_section9),getString(R.string.title_section11),getString(R.string.title_section12),getString(R.string.title_section13),"String_Node_Str"}));
  mDrawerListView.setItemChecked(mCurrentSelectedPosition,true);
  return mDrawerListView;
}
Program: 57739
Project: 57739
Buggy source:
@Override public void onClick(View view){
  if (view == encryptButton) {
    String inputStr=mingEdit.getText().toString();
    if (inputStr == null) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] inputData=inputStr.getBytes();
    byte[] outputData=new byte[0];
    try {
      outputData=sha.encryptSHA(inputData,shaNumber);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    BigInteger shaData=new BigInteger(1,outputData);
    miEdit.setText(shaData.toString(16));
  }
}

Fixed version (ground truth):
@Override public void onClick(View view){
  if (view == encryptButton) {
    String inputStr=mingEdit.getText().toString();
    if (inputStr.equals("String_Node_Str")) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      return;
    }
    byte[] inputData=inputStr.getBytes();
    byte[] outputData=new byte[0];
    try {
      outputData=sha.encryptSHA(inputData,shaNumber);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    BigInteger shaData=new BigInteger(1,outputData);
    miEdit.setText(shaData.toString(16));
  }
}
Program: 57740
Project: 57740
Buggy source:
/** 
 * Add a custom configured serialiser
 * @param serialiser
 * @return
 */
public CsvDataExtractor withSerialiser(CsvSerializer serialiser){
  super.serialiser=serialiser;
  return this;
}

Fixed version (ground truth):
/** 
 * Add a custom configured serialiser
 * @param serialiser
 * @return
 */
public CsvDataExtractor withSerialiser(CsvSerializer serialiser){
  this.serialiser=serialiser;
  super.serialiser=serialiser;
  return this;
}
Program: 57741
Project: 57741
Buggy source:
public CsvDataExtractor(List<Integer> labelIndicies,String labelAttributeAlias,int dateValueIndex,String dateAttributeAlias,String fieldDelimiter,CsvSerializer serialiser){
  super.labelIndicies=labelIndicies;
  super.labelAttributeAlias=labelAttributeAlias;
  super.dateValueIndex=dateValueIndex;
  super.dateAttributeAlias=dateAttributeAlias;
  this.serialiser=serialiser;
}

Fixed version (ground truth):
public CsvDataExtractor(List<Integer> labelIndicies,String labelAttributeAlias,int dateValueIndex,String dateAttributeAlias,String fieldDelimiter,CsvSerializer serialiser){
  super.labelIndicies=labelIndicies;
  super.labelAttributeAlias=labelAttributeAlias;
  super.dateValueIndex=dateValueIndex;
  super.dateAttributeAlias=dateAttributeAlias;
  this.serialiser=serialiser;
  super.serialiser=serialiser;
}
Program: 57742
Project: 57742
Buggy source:
public String expandRoll(MapToolVariableResolver resolver,Token tokenInContext,String roll) throws ParserException {
  try {
    Result result=parseExpression(resolver,tokenInContext,roll);
    StringBuilder sb=new StringBuilder();
    if (result.getDetailExpression().equals(result.getValue().toString())) {
      sb.append(result.getDetailExpression());
    }
 else {
      sb.append(result.getDetailExpression()).append("String_Node_Str").append(result.getValue());
    }
    return sb.toString();
  }
 catch (  AbortFunctionException ae) {
    throw ae;
  }
catch (  AssertFunctionException afe) {
    throw afe;
  }
catch (  ParserException e) {
    return I18N.getText("String_Node_Str",roll);
  }
}

Fixed version (ground truth):
public String expandRoll(MapToolVariableResolver resolver,Token tokenInContext,String roll) throws ParserException {
  try {
    Result result=parseExpression(resolver,tokenInContext,roll);
    StringBuilder sb=new StringBuilder();
    if (result.getDetailExpression().equals(result.getValue().toString())) {
      sb.append(result.getDetailExpression());
    }
 else {
      sb.append(result.getDetailExpression()).append("String_Node_Str").append(result.getValue());
    }
    return sb.toString();
  }
 catch (  AbortFunctionException ae) {
    throw ae;
  }
catch (  AssertFunctionException afe) {
    throw afe;
  }
catch (  ParserException e) {
    throw e;
  }
catch (  Exception e) {
    return I18N.getText("String_Node_Str",roll);
  }
}
Program: 57743
Project: 57743
Buggy source:
private MathFunctions(){
  super(1,UNLIMITED_PARAMETERS,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private MathFunctions(){
  super(0,UNLIMITED_PARAMETERS,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 57744
Project: 57744
Buggy source:
private List<BigDecimal> getNumericParams(List<Object> param,int minParams,int maxParams,String functionName) throws ParserException {
  if (minParams == minParams) {
    if (param.size() != minParams) {
      throw new ParserException(I18N.getText("String_Node_Str",functionName,minParams,param.size()));
    }
  }
 else   if (param.size() < minParams) {
    throw new ParserException(I18N.getText("String_Node_Str",functionName,minParams,param.size()));
  }
 else   if (maxParams != UNLIMITED_PARAMETERS && param.size() > maxParams) {
    throw new ParserException(I18N.getText("String_Node_Str",functionName,maxParams,param.size()));
  }
  int i=0;
  List<BigDecimal> outVals=new ArrayList<>();
  for (  Object o : param) {
    if (o instanceof BigDecimal) {
      outVals.add((BigDecimal)o);
    }
 else {
      throw new ParserException(I18N.getText("String_Node_Str",functionName,i,o.toString()));
    }
  }
  return outVals;
}

Fixed version (ground truth):
private List<BigDecimal> getNumericParams(List<Object> param,int minParams,int maxParams,String functionName) throws ParserException {
  if (minParams == maxParams) {
    if (param.size() != minParams) {
      throw new ParserException(I18N.getText("String_Node_Str",functionName,minParams,param.size()));
    }
  }
 else   if (param.size() < minParams) {
    throw new ParserException(I18N.getText("String_Node_Str",functionName,minParams,param.size()));
  }
 else   if (maxParams != UNLIMITED_PARAMETERS && param.size() > maxParams) {
    throw new ParserException(I18N.getText("String_Node_Str",functionName,maxParams,param.size()));
  }
  int i=0;
  List<BigDecimal> outVals=new ArrayList<>();
  for (  Object o : param) {
    if (o instanceof BigDecimal) {
      outVals.add((BigDecimal)o);
    }
 else {
      throw new ParserException(I18N.getText("String_Node_Str",functionName,i,o.toString()));
    }
  }
  return outVals;
}
Program: 57746
Project: 57746
Buggy source:
public void showDialog(){
  EventQueue.invokeLater(new Runnable(){
    public void run(){
      dialog=new GenericDialog("String_Node_Str",MapTool.getFrame(),NewTokenDialog.this){
        @Override protected void positionInitialView(){
          Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
          Dimension size=getSize();
          int x=centerX - size.width / 2;
          int y=centerY - size.height / 2;
          if (x < 0) {
            x=0;
          }
          if (y < 0) {
            y=0;
          }
          if (x + size.width > screenSize.width) {
            x=screenSize.width - size.width;
          }
          if (y + size.height > screenSize.height) {
            y=screenSize.height - size.height;
          }
          setLocation(x,y);
        }
      }
;
      bind(token);
      getRootPane().setDefaultButton(getOKButton());
      dialog.showDialog();
    }
  }
);
}

Fixed version (ground truth):
public void showDialog(){
  dialog=new GenericDialog("String_Node_Str",MapTool.getFrame(),this){
    @Override protected void positionInitialView(){
      Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
      Dimension size=getSize();
      int x=centerX - size.width / 2;
      int y=centerY - size.height / 2;
      if (x < 0) {
        x=0;
      }
      if (y < 0) {
        y=0;
      }
      if (x + size.width > screenSize.width) {
        x=screenSize.width - size.width;
      }
      if (y + size.height > screenSize.height) {
        y=screenSize.height - size.height;
      }
      setLocation(x,y);
    }
  }
;
  bind(token);
  getRootPane().setDefaultButton(getOKButton());
  dialog.showDialog();
}
Program: 57747
Project: 57747
Buggy source:
public void showDialog(){
  dialog=new GenericDialog("String_Node_Str",MapTool.getFrame(),this){
    @Override protected void positionInitialView(){
      Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
      Dimension size=getSize();
      int x=centerX - size.width / 2;
      int y=centerY - size.height / 2;
      if (x < 0) {
        x=0;
      }
      if (y < 0) {
        y=0;
      }
      if (x + size.width > screenSize.width) {
        x=screenSize.width - size.width;
      }
      if (y + size.height > screenSize.height) {
        y=screenSize.height - size.height;
      }
      setLocation(x,y);
    }
  }
;
  bind(token);
  getRootPane().setDefaultButton(getOKButton());
  dialog.showDialog();
}

Fixed version (ground truth):
public void showDialog(){
  EventQueue.invokeLater(new Runnable(){
    public void run(){
      dialog=new GenericDialog("String_Node_Str",MapTool.getFrame(),NewTokenDialog.this){
        @Override protected void positionInitialView(){
          Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
          Dimension size=getSize();
          int x=centerX - size.width / 2;
          int y=centerY - size.height / 2;
          if (x < 0) {
            x=0;
          }
          if (y < 0) {
            y=0;
          }
          if (x + size.width > screenSize.width) {
            x=screenSize.width - size.width;
          }
          if (y + size.height > screenSize.height) {
            y=screenSize.height - size.height;
          }
          setLocation(x,y);
        }
      }
;
      bind(token);
      getRootPane().setDefaultButton(getOKButton());
      dialog.showDialog();
    }
  }
);
}
Program: 57748
Project: 57748
Buggy source:
/** 
 * Returns a checkbox that indicates whether the filter field applies to <i>all</i> images in all libraries or just the currently selected image directory. Currently not implemented.
 * @return the checkbox component
 */
public JCheckBox getGlobalSearchField(){
  if (globalSearchField == null) {
    globalSearchField=new JCheckBox("String_Node_Str",false);
    globalSearchField.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent ev){
        updateFilter();
      }
    }
);
  }
  return globalSearchField;
}

Fixed version (ground truth):
/** 
 * Returns a checkbox that indicates whether the filter field applies to <i>all</i> images in all libraries or just the currently selected image directory. Currently not implemented.
 * @return the checkbox component
 */
private JCheckBox getGlobalSearchField(){
  if (globalSearchField == null) {
    globalSearchField=new JCheckBox(I18N.getText("String_Node_Str"),false);
    globalSearchField.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent ev){
        updateFilter();
      }
    }
);
  }
  return globalSearchField;
}
Program: 57749
Project: 57749
Buggy source:
private synchronized void updateFilter(){
  if (updateFilterTimer == null) {
    updateFilterTimer=new Timer(500,new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        ImageFileImagePanelModel model=(ImageFileImagePanelModel)imagePanel.getModel();
        if (model == null) {
          return;
        }
        model.setFilter(getFilterTextField().getText());
        imagePanel.revalidate();
        imagePanel.repaint();
        updateFilterTimer.stop();
        updateFilterTimer=null;
      }
    }
);
    updateFilterTimer.start();
  }
 else {
    updateFilterTimer.restart();
  }
}

Fixed version (ground truth):
private synchronized void updateFilter(){
  if (updateFilterTimer == null) {
    updateFilterTimer=new Timer(500,new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        ImageFileImagePanelModel model=(ImageFileImagePanelModel)imagePanel.getModel();
        if (model == null) {
          return;
        }
        model.setGlobalSearch(getGlobalSearchField().isSelected());
        model.setFilter(getFilterTextField().getText());
        imagePanel.revalidate();
        imagePanel.repaint();
        updateFilterTimer.stop();
        updateFilterTimer=null;
      }
    }
);
    updateFilterTimer.start();
  }
 else {
    updateFilterTimer.restart();
  }
}
Program: 57750
Project: 57750
Buggy source:
public void actionPerformed(ActionEvent e){
  ImageFileImagePanelModel model=(ImageFileImagePanelModel)imagePanel.getModel();
  if (model == null) {
    return;
  }
  model.setFilter(getFilterTextField().getText());
  imagePanel.revalidate();
  imagePanel.repaint();
  updateFilterTimer.stop();
  updateFilterTimer=null;
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  ImageFileImagePanelModel model=(ImageFileImagePanelModel)imagePanel.getModel();
  if (model == null) {
    return;
  }
  model.setGlobalSearch(getGlobalSearchField().isSelected());
  model.setFilter(getFilterTextField().getText());
  imagePanel.revalidate();
  imagePanel.repaint();
  updateFilterTimer.stop();
  updateFilterTimer=null;
}
Program: 57751
Project: 57751
Buggy source:
/** 
 * Creates the GUI for the bottom half of the splitpane that allows for finding assets within any of the repository locations (such as local directories).
 * @return
 */
private JPanel createFilterPanel(){
  JPanel panel=new JPanel(new BorderLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
  JPanel top=new JPanel(new BorderLayout());
  top.add(BorderLayout.WEST,new JLabel("String_Node_Str",FILTER_IMAGE,JLabel.LEFT));
  top.add(BorderLayout.CENTER,getFilterTextField());
  panel.add(BorderLayout.NORTH,top);
  return panel;
}

Fixed version (ground truth):
/** 
 * Creates the GUI for the bottom half of the splitpane that allows for finding assets within any of the repository locations (such as local directories).
 * @return
 */
private JPanel createFilterPanel(){
  JPanel panel=new JPanel(new BorderLayout());
  panel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
  JPanel top=new JPanel(new BorderLayout());
  top.add(BorderLayout.WEST,new JLabel("String_Node_Str",FILTER_IMAGE,JLabel.LEFT));
  top.add(BorderLayout.CENTER,getFilterTextField());
  panel.add(BorderLayout.NORTH,top);
  panel.add(BorderLayout.SOUTH,getGlobalSearchField());
  return panel;
}
Program: 57752
Project: 57752
Buggy source:
private JSONObject getInitiativeDetails(){
  JSONObject json=new JSONObject();
  InitiativeList initiativeList=MapTool.getFrame().getCurrentZoneRenderer().getZone().getInitiativeList();
  List<net.rptools.maptool.model.InitiativeList.TokenInitiative> tokenInitList=initiativeList.getTokens();
  JSONArray tokArray=new JSONArray();
  int index=0;
  for (  InitiativeList.TokenInitiative token : tokenInitList) {
    if (InitiativeListModel.isTokenVisible(token.getToken(),initiativeList.isHideNPC())) {
      JSONObject tokJSon=new JSONObject();
      tokJSon.put("String_Node_Str",token.getToken().getId().toString());
      tokJSon.put("String_Node_Str",token.getToken().getName());
      tokJSon.put("String_Node_Str",token.isHolding());
      tokJSon.put("String_Node_Str",token.getState());
      tokJSon.put("String_Node_Str",index);
      tokJSon.put("String_Node_Str",AppUtil.playerOwns(token.getToken()));
      tokJSon.put("String_Node_Str","String_Node_Str");
      tokArray.add(tokJSon);
    }
    index++;
  }
  json.put("String_Node_Str",tokArray);
  json.put("String_Node_Str",initiativeList.getCurrent());
  json.put("String_Node_Str",initiativeList.getRound());
  json.put("String_Node_Str",canAdvanceInitiative());
  return json;
}

Fixed version (ground truth):
private JSONObject getInitiativeDetails(){
  JSONObject json=new JSONObject();
  InitiativeList initiativeList=MapTool.getFrame().getCurrentZoneRenderer().getZone().getInitiativeList();
  List<net.rptools.maptool.model.InitiativeList.TokenInitiative> tokenInitList=initiativeList.getTokens();
  JSONArray tokArray=new JSONArray();
  int index=0;
  for (  InitiativeList.TokenInitiative token : tokenInitList) {
    if (InitiativeListModel.isTokenVisible(token.getToken(),initiativeList.isHideNPC())) {
      JSONObject tokJSon=new JSONObject();
      tokJSon.put("String_Node_Str",token.getToken().getId().toString());
      tokJSon.put("String_Node_Str",token.getToken().getName());
      tokJSon.put("String_Node_Str",token.isHolding());
      tokJSon.put("String_Node_Str",token.getState());
      tokJSon.put("String_Node_Str",index);
      tokJSon.put("String_Node_Str",AppUtil.playerOwns(token.getToken()));
      tokArray.add(tokJSon);
    }
    index++;
  }
  json.put("String_Node_Str",tokArray);
  json.put("String_Node_Str",initiativeList.getCurrent());
  json.put("String_Node_Str",initiativeList.getRound());
  json.put("String_Node_Str",canAdvanceInitiative());
  return json;
}
Program: 57753
Project: 57753
Buggy source:
public Token findTokenFromId(String tokenId){
  final GUID id=new GUID(tokenId);
  final List<Token> tokenList=new ArrayList<>();
  List<ZoneRenderer> zrenderers=MapTool.getFrame().getZoneRenderers();
  for (  ZoneRenderer zr : zrenderers) {
    tokenList.addAll(zr.getZone().getTokensFiltered(new Zone.Filter(){
      public boolean matchToken(      Token t){
        return t.getId().equals(id);
      }
    }
));
    if (tokenList.size() > 0) {
      break;
    }
  }
  if (tokenList.size() > 0) {
    return tokenList.get(0);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Token findTokenFromId(String tokenId){
  System.out.println("String_Node_Str" + tokenId);
  final GUID id=new GUID(tokenId);
  final List<Token> tokenList=new ArrayList<>();
  List<ZoneRenderer> zrenderers=MapTool.getFrame().getZoneRenderers();
  for (  ZoneRenderer zr : zrenderers) {
    tokenList.addAll(zr.getZone().getTokensFiltered(new Zone.Filter(){
      public boolean matchToken(      Token t){
        return t.getId().equals(id);
      }
    }
));
    if (tokenList.size() > 0) {
      break;
    }
  }
  if (tokenList.size() > 0) {
    return tokenList.get(0);
  }
 else {
    return null;
  }
}
Program: 57754
Project: 57754
Buggy source:
public int doSuccessSolution(String md5){
  File permDir=new File(mContext.getFilesDir().getAbsoluteFile(),"String_Node_Str");
  if (permDir.exists() == true) {
    File outFile=new File(permDir,md5);
    if (outFile.exists() == true) {
      System.load(outFile.getAbsolutePath());
      int nRet=jmain(0);
      junmain(getClass());
      return nRet;
    }
  }
  return Constants.ROOT_FAILED_SOLUTION_FILE_NOT_EXISTS;
}

Fixed version (ground truth):
public int doSuccessSolution(String md5){
  NativeHelper.copyNativeLib(mContext,"String_Node_Str");
  String filePath=mContext.getFilesDir().getAbsoluteFile() + "String_Node_Str" + md5;
  File outFile=new File(filePath);
  if (outFile.exists() == true) {
    System.load(filePath);
    int nRet=jmain(0);
    junmain(getClass());
    return nRet;
  }
  return Constants.ROOT_FAILED_SOLUTION_FILE_NOT_EXISTS;
}
Program: 57756
Project: 57756
Buggy source:
public void handleMessage(Message msg){
  String text=String.valueOf(msg.obj);
  mStatusText.setText(text);
  super.handleMessage(msg);
}

Fixed version (ground truth):
public void handleMessage(Message msg){
  String text=String.valueOf(msg.obj);
  mStatusText.append(text);
  super.handleMessage(msg);
}