nus-yam/ex-repair huggingface dataset:
Program: 55002
Project: 55002
Buggy source:
@Override public void run(){
  SamplePacket inputSamples=null;
  SamplePacket audioBuffer=null;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  audioSink.start();
  decimator.start();
  while (!stopRequested) {
    inputSamples=decimator.getDecimatedPacket(1000);
    if (inputSamples == null) {
      Log.d(LOGTAG,"String_Node_Str");
      continue;
    }
    applyUserFilter(inputSamples,quadratureSamples);
    decimator.returnDecimatedPacket(inputSamples);
    if (squelch <= 0 || testSquelchThreshold(quadratureSamples)) {
      audioBuffer=audioSink.getPacketBuffer(1000);
switch (demodulationMode) {
case DEMODULATION_OFF:
        break;
case DEMODULATION_AM:
      demodulateAM(quadratureSamples,audioBuffer);
    break;
case DEMODULATION_NFM:
  demodulateFM(quadratureSamples,audioBuffer,5000);
break;
case DEMODULATION_WFM:
demodulateFM(quadratureSamples,audioBuffer,75000);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + demodulationMode);
}
audioSink.enqueuePacket(audioBuffer);
}
}
audioSink.stopSink();
decimator.stopDecimator();
this.stopRequested=true;
Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  SamplePacket inputSamples=null;
  SamplePacket audioBuffer=null;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  audioSink.start();
  decimator.start();
  while (!stopRequested) {
    inputSamples=decimator.getDecimatedPacket(1000);
    if (inputSamples == null) {
      continue;
    }
    applyUserFilter(inputSamples,quadratureSamples);
    decimator.returnDecimatedPacket(inputSamples);
    audioBuffer=audioSink.getPacketBuffer(1000);
switch (demodulationMode) {
case DEMODULATION_OFF:
      break;
case DEMODULATION_AM:
    demodulateAM(quadratureSamples,audioBuffer);
  break;
case DEMODULATION_NFM:
demodulateFM(quadratureSamples,audioBuffer,5000);
break;
case DEMODULATION_WFM:
demodulateFM(quadratureSamples,audioBuffer,75000);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + demodulationMode);
}
audioSink.enqueuePacket(audioBuffer);
}
audioSink.stopSink();
decimator.stopDecimator();
this.stopRequested=true;
Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}
Program: 55005
Project: 55005
Buggy source:
@Override protected void onStart(){
  super.onStart();
  checkForChangedPreferences();
  if (running)   startAnalyzer();
  if (savedInstanceState != null) {
    analyzerSurface.setVirtualFrequency(savedInstanceState.getLong(getString(R.string.save_state_virtualFrequency)));
    analyzerSurface.setVirtualSampleRate(savedInstanceState.getInt(getString(R.string.save_state_virtualSampleRate)));
    analyzerSurface.setDBScale(savedInstanceState.getFloat(getString(R.string.save_state_minDB)),savedInstanceState.getFloat(getString(R.string.save_state_maxDB)));
    analyzerSurface.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    analyzerSurface.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
    analyzerSurface.setSquelch(savedInstanceState.getFloat(getString(R.string.save_state_squelch)));
    if (demodulator != null && scheduler != null) {
      demodulator.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
      demodulator.setSquelch(savedInstanceState.getFloat(getString(R.string.save_state_squelch)));
      scheduler.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    }
    savedInstanceState=null;
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  checkForChangedPreferences();
  if (running)   startAnalyzer();
  if (savedInstanceState != null) {
    analyzerSurface.setVirtualFrequency(savedInstanceState.getLong(getString(R.string.save_state_virtualFrequency)));
    analyzerSurface.setVirtualSampleRate(savedInstanceState.getInt(getString(R.string.save_state_virtualSampleRate)));
    analyzerSurface.setDBScale(savedInstanceState.getFloat(getString(R.string.save_state_minDB)),savedInstanceState.getFloat(getString(R.string.save_state_maxDB)));
    analyzerSurface.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    analyzerSurface.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
    analyzerSurface.setSquelch(savedInstanceState.getFloat(getString(R.string.save_state_squelch)));
    if (demodulator != null && scheduler != null) {
      demodulator.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
      scheduler.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    }
    savedInstanceState=null;
  }
}
Program: 55007
Project: 55007
Buggy source:
@Override public void run(){
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  SamplePacket fftBuffer=null;
  SamplePacket demodBuffer=null;
  SamplePacket tmpFlushBuffer=null;
  while (!stopRequested) {
    byte[] packet=source.getPacket(1000);
    if (packet == null) {
      Log.e(LOGTAG,"String_Node_Str");
      this.stopScheduler();
      break;
    }
    if (demodulationActivated) {
      demodBuffer=demodInputQueue.poll();
      if (demodBuffer != null) {
        demodBuffer.setSize(0);
        source.mixPacketIntoSamplePacket(packet,demodBuffer,channelFrequency);
        demodOutputQueue.offer(demodBuffer);
      }
 else {
        Log.d(LOGTAG,"String_Node_Str");
        while ((tmpFlushBuffer=demodOutputQueue.poll()) != null)         demodInputQueue.offer(tmpFlushBuffer);
      }
    }
    if (fftBuffer == null) {
      fftBuffer=fftInputQueue.poll();
      if (fftBuffer != null)       fftBuffer.setSize(0);
    }
    if (fftBuffer != null) {
      source.fillPacketIntoSamplePacket(packet,fftBuffer);
      if (fftBuffer.capacity() == fftBuffer.size()) {
        fftOutputQueue.offer(fftBuffer);
        fftBuffer=null;
      }
    }
    source.returnPacket(packet);
  }
  this.stopRequested=true;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  SamplePacket fftBuffer=null;
  SamplePacket demodBuffer=null;
  SamplePacket tmpFlushBuffer=null;
  while (!stopRequested) {
    byte[] packet=source.getPacket(1000);
    if (packet == null) {
      Log.e(LOGTAG,"String_Node_Str");
      this.stopScheduler();
      break;
    }
    if (demodulationActivated && squelchSatisfied) {
      demodBuffer=demodInputQueue.poll();
      if (demodBuffer != null) {
        demodBuffer.setSize(0);
        source.mixPacketIntoSamplePacket(packet,demodBuffer,channelFrequency);
        demodOutputQueue.offer(demodBuffer);
      }
 else {
        Log.d(LOGTAG,"String_Node_Str");
        while ((tmpFlushBuffer=demodOutputQueue.poll()) != null)         demodInputQueue.offer(tmpFlushBuffer);
      }
    }
    if (fftBuffer == null) {
      fftBuffer=fftInputQueue.poll();
      if (fftBuffer != null)       fftBuffer.setSize(0);
    }
    if (fftBuffer != null) {
      source.fillPacketIntoSamplePacket(packet,fftBuffer);
      if (fftBuffer.capacity() == fftBuffer.size()) {
        fftOutputQueue.offer(fftBuffer);
        fftBuffer=null;
      }
    }
    source.returnPacket(packet);
  }
  this.stopRequested=true;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}
Program: 55008
Project: 55008
Buggy source:
/** 
 * Set the font size
 * @param fontSize FONT_SIZE_SMALL, *_MEDIUM or *_LARGE
 */
public void setFontSize(int fontSize){
  int normalTextSize;
  int smallTextSize;
switch (fontSize) {
case FONT_SIZE_SMALL:
    normalTextSize=(int)(getGridSize() / 2.5);
  smallTextSize=(int)(normalTextSize * 0.7);
break;
case FONT_SIZE_MEDIUM:
normalTextSize=(int)(getGridSize() / 2.1);
smallTextSize=(int)(normalTextSize * 0.5);
break;
case FONT_SIZE_LARGE:
normalTextSize=(int)(getGridSize() / 1.8);
smallTextSize=(int)(normalTextSize * 0.3);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + fontSize);
return;
}
this.fontSize=fontSize;
this.textPaint.setTextSize(normalTextSize);
this.textSmallPaint.setTextSize(smallTextSize);
}

Fixed version (ground truth):
/** 
 * Set the font size
 * @param fontSize FONT_SIZE_SMALL, *_MEDIUM or *_LARGE
 */
public void setFontSize(int fontSize){
  int normalTextSize;
  int smallTextSize;
switch (fontSize) {
case FONT_SIZE_SMALL:
    normalTextSize=(int)(getGridSize() * 0.3);
  smallTextSize=(int)(getGridSize() * 0.2);
break;
case FONT_SIZE_MEDIUM:
normalTextSize=(int)(getGridSize() * 0.476);
smallTextSize=(int)(getGridSize() * 0.25);
break;
case FONT_SIZE_LARGE:
normalTextSize=(int)(getGridSize() * 0.7);
smallTextSize=(int)(getGridSize() * 0.35);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + fontSize);
return;
}
this.fontSize=fontSize;
this.textPaint.setTextSize(normalTextSize);
this.textSmallPaint.setTextSize(smallTextSize);
}
Program: 55011
Project: 55011
Buggy source:
/** 
 * This method will do the signal processing (fft) on the given samples
 * @param samples	input samples for the signal processing
 */
public void doProcessing(SamplePacket samples){
  this.fftBlock.applyWindow(samples.re(),samples.im());
  this.fftBlock.fft(samples.re(),samples.im());
  double realPower;
  double imagPower;
  int size=samples.size();
  for (int i=0; i < size; i++) {
    int targetIndex=(i + size / 2) % size;
    realPower=samples.re(i) / fftSize;
    realPower=realPower * realPower;
    imagPower=samples.im(i) / fftSize;
    imagPower=imagPower * imagPower;
    mag[targetIndex]=Math.log(realPower + imagPower);
  }
}

Fixed version (ground truth):
/** 
 * This method will do the signal processing (fft) on the given samples
 * @param samples	input samples for the signal processing
 */
public void doProcessing(SamplePacket samples){
  this.fftBlock.applyWindow(samples.re(),samples.im());
  this.fftBlock.fft(samples.re(),samples.im());
  double realPower;
  double imagPower;
  int size=samples.size();
  for (int i=0; i < size; i++) {
    int targetIndex=(i + size / 2) % size;
    realPower=samples.re(i) / fftSize;
    realPower=realPower * realPower;
    imagPower=samples.im(i) / fftSize;
    imagPower=imagPower * imagPower;
    mag[targetIndex]=10 * Math.log10(Math.sqrt(realPower + imagPower));
  }
}
Program: 55012
Project: 55012
Buggy source:
public void setDemodulationEnabled(boolean demodulationEnabled){
synchronized (this.getHolder()) {
    if (demodulationEnabled) {
      this.virtualSampleRate=(int)(source.getSampleRate() * 0.9);
      source.setFrequency(virtualFrequency);
      this.channelFrequency=virtualFrequency;
      this.squelch=minDB + (maxDB - minDB) / 10;
    }
    this.demodulationEnabled=demodulationEnabled;
  }
}

Fixed version (ground truth):
public void setDemodulationEnabled(boolean demodulationEnabled){
synchronized (this.getHolder()) {
    if (demodulationEnabled) {
      this.virtualSampleRate=(int)(source.getSampleRate() * 0.9);
      source.setFrequency(virtualFrequency);
      if (channelFrequency < virtualFrequency - virtualSampleRate / 2 || channelFrequency > virtualFrequency + virtualSampleRate / 2) {
        this.channelFrequency=virtualFrequency;
        callbackHandler.onUpdateChannelFrequency(channelFrequency);
      }
      this.channelWidth=callbackHandler.onCurrentChannelWidthRequested();
      if (squelch < minDB || squelch > maxDB) {
        this.squelch=minDB + (maxDB - minDB) / 4;
        callbackHandler.onUpdateSquelch(squelch);
      }
    }
    this.demodulationEnabled=demodulationEnabled;
  }
}
Program: 55013
Project: 55013
Buggy source:
/** 
 * Returns the squelch threshold in dB!
 * @return	squelch threshold in dB
 */
public double getSquelch(){
  return Math.log(squelch);
}

Fixed version (ground truth):
/** 
 * Returns the squelch threshold in dB!
 * @return	squelch threshold in dB
 */
public double getSquelch(){
  return 10 * Math.log10(squelch);
}
Program: 55014
Project: 55014
Buggy source:
private void applyUserFilter(SamplePacket input,SamplePacket output){
  if (userFilter == null || ((int)userFilter.getCutOffFrequency()) != userFilterCutOff) {
    this.userFilter=FirFilter.createLowPass(1,1,input.getSampleRate(),userFilterCutOff,input.getSampleRate() * 0.10,USER_FILTER_ATTENUATION);
    Log.d(LOGTAG,"String_Node_Str" + userFilter.getNumberOfTaps() + "String_Node_Str"+ userFilter.getDecimation()+ "String_Node_Str"+ userFilter.getCutOffFrequency()+ "String_Node_Str"+ userFilter.getTransitionWidth());
  }
  output.setSize(0);
  if (userFilter.filter(input,output,0,input.size()) < input.size()) {
    Log.e(LOGTAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void applyUserFilter(SamplePacket input,SamplePacket output){
  if (userFilter == null || ((int)userFilter.getCutOffFrequency()) != userFilterCutOff) {
    this.userFilter=FirFilter.createLowPass(1,1,input.getSampleRate(),userFilterCutOff,input.getSampleRate() * 0.10,USER_FILTER_ATTENUATION);
    if (userFilter == null)     return;
    Log.d(LOGTAG,"String_Node_Str" + userFilter.getNumberOfTaps() + "String_Node_Str"+ userFilter.getDecimation()+ "String_Node_Str"+ userFilter.getCutOffFrequency()+ "String_Node_Str"+ userFilter.getTransitionWidth());
  }
  output.setSize(0);
  if (userFilter.filter(input,output,0,input.size()) < input.size()) {
    Log.e(LOGTAG,"String_Node_Str");
  }
}
Program: 55015
Project: 55015
Buggy source:
@Override public void run(){
  SamplePacket inputSamples=null;
  SamplePacket audioBuffer=null;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  audioSink.start();
  decimator.start();
  while (!stopRequested) {
    inputSamples=decimator.getDecimatedPacket(1000);
    if (inputSamples == null) {
      Log.d(LOGTAG,"String_Node_Str");
      continue;
    }
    applyUserFilter(inputSamples,quadratureSamples);
    decimator.returnDecimatedPacket(inputSamples);
    if (squelch <= 0 || testSquelchThreshold(quadratureSamples)) {
      audioBuffer=audioSink.getPacketBuffer(1000);
switch (demodulationMode) {
case DEMODULATION_OFF:
        break;
case DEMODULATION_AM:
      break;
case DEMODULATION_NFM:
    demodulateFM(quadratureSamples,audioBuffer,5000);
  break;
case DEMODULATION_WFM:
demodulateFM(quadratureSamples,audioBuffer,75000);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + demodulationMode);
}
audioSink.enqueuePacket(audioBuffer);
}
}
audioSink.stopSink();
decimator.stopDecimator();
this.stopRequested=true;
Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  SamplePacket inputSamples=null;
  SamplePacket audioBuffer=null;
  Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
  audioSink.start();
  decimator.start();
  while (!stopRequested) {
    inputSamples=decimator.getDecimatedPacket(1000);
    if (inputSamples == null) {
      Log.d(LOGTAG,"String_Node_Str");
      continue;
    }
    applyUserFilter(inputSamples,quadratureSamples);
    decimator.returnDecimatedPacket(inputSamples);
    if (squelch <= 0 || testSquelchThreshold(quadratureSamples)) {
      audioBuffer=audioSink.getPacketBuffer(1000);
switch (demodulationMode) {
case DEMODULATION_OFF:
        break;
case DEMODULATION_AM:
      demodulateAM(quadratureSamples,audioBuffer);
    break;
case DEMODULATION_NFM:
  demodulateFM(quadratureSamples,audioBuffer,5000);
break;
case DEMODULATION_WFM:
demodulateFM(quadratureSamples,audioBuffer,75000);
break;
default :
Log.e(LOGTAG,"String_Node_Str" + demodulationMode);
}
audioSink.enqueuePacket(audioBuffer);
}
}
audioSink.stopSink();
decimator.stopDecimator();
this.stopRequested=true;
Log.i(LOGTAG,"String_Node_Str" + this.getName() + "String_Node_Str");
}
Program: 55016
Project: 55016
Buggy source:
private void demodulateAM(SamplePacket input,SamplePacket output){
  double[] reIn=input.re();
  double[] imIn=input.im();
  double[] reOut=output.re();
  for (int i=0; i < input.size(); i++)   reOut[i]=(reIn[i] * reIn[i] + imIn[i] * imIn[i]) * 0.5;
  output.setSize(input.size());
  output.setSampleRate(QUADRATURE_RATE[demodulationMode]);
}

Fixed version (ground truth):
private void demodulateAM(SamplePacket input,SamplePacket output){
  double[] reIn=input.re();
  double[] imIn=input.im();
  double[] reOut=output.re();
  for (int i=0; i < input.size(); i++)   reOut[i]=(reIn[i] * reIn[i] + imIn[i] * imIn[i]) - 1;
  output.setSize(input.size());
  output.setSampleRate(QUADRATURE_RATE[demodulationMode]);
}
Program: 55017
Project: 55017
Buggy source:
private boolean testSquelchThreshold(SamplePacket input){
  double[] re=input.re();
  double[] im=input.im();
  double sum=0;
  int size=input.size();
  int stepSize=size / 10;
  for (int i=0; i < size; i+=stepSize)   sum=re[i] * re[i] + im[i] * im[i];
  return sum / (size / stepSize) > squelch;
}

Fixed version (ground truth):
private boolean testSquelchThreshold(SamplePacket input){
  double[] re=input.re();
  double[] im=input.im();
  double sum=0;
  int size=input.size();
  int stepSize=size / 10;
  for (int i=0; i < size; i+=stepSize)   sum=re[i] * re[i] + im[i] * im[i];
  if (System.currentTimeMillis() % 100 == 0)   Log.d(LOGTAG,"String_Node_Str" + squelch + "String_Node_Str"+ 10 * Math.log10(squelch) + "String_Node_Str" + sum / (size / stepSize) + "String_Node_Str" + 10 * Math.log10(Math.sqrt(sum / (size / stepSize))) + "String_Node_Str");
  return sum / (size / stepSize) > squelch;
}
Program: 55018
Project: 55018
Buggy source:
/** 
 * Sets the squelch threshold
 * @param squelch squelch threshold in dB!
 */
public void setSquelch(double squelch){
  this.squelch=Math.pow(10,squelch);
}

Fixed version (ground truth):
/** 
 * Sets the squelch threshold
 * @param squelch squelch threshold in dB!
 */
public void setSquelch(double squelch){
  this.squelch=Math.pow(10,0.1 * squelch);
}
Program: 55019
Project: 55019
Buggy source:
/** 
 * Will set the modulation mode to the given value. Takes care of adjusting the scheduler and the demodulator respectively and updates the action bar menu item.
 * @param mode	Demodulator.DEMODULATION_OFF, *_AM, *_NFM, *_WFM
 */
public void setDemodulationMode(int mode){
  if (scheduler == null || demodulator == null || source == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  if (mode == Demodulator.DEMODULATION_OFF) {
    scheduler.setDemodulationActivated(false);
  }
 else {
    source.setSampleRate(Demodulator.INPUT_RATE);
    if (source.getSampleRate() != Demodulator.INPUT_RATE) {
      Log.e(LOGTAG,"String_Node_Str");
      Toast.makeText(MainActivity.this,"String_Node_Str" + Demodulator.INPUT_RATE / 1000000 + "String_Node_Str",Toast.LENGTH_LONG).show();
      scheduler.setDemodulationActivated(false);
      mode=Demodulator.DEMODULATION_OFF;
    }
 else {
      scheduler.setDemodulationActivated(true);
    }
  }
  demodulator.setDemodulationMode(mode);
  this.demodulationMode=mode;
  if (mode == Demodulator.DEMODULATION_OFF) {
    analyzerSurface.setDemodulationEnabled(false);
  }
 else {
    analyzerSurface.setDemodulationEnabled(true);
    analyzerSurface.setChannelWidth(demodulator.getChannelWidth());
  }
  updateActionBar();
}

Fixed version (ground truth):
/** 
 * Will set the modulation mode to the given value. Takes care of adjusting the scheduler and the demodulator respectively and updates the action bar menu item.
 * @param mode	Demodulator.DEMODULATION_OFF, *_AM, *_NFM, *_WFM
 */
public void setDemodulationMode(int mode){
  if (scheduler == null || demodulator == null || source == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  if (mode == Demodulator.DEMODULATION_OFF) {
    scheduler.setDemodulationActivated(false);
  }
 else {
    source.setSampleRate(Demodulator.INPUT_RATE);
    if (source.getSampleRate() != Demodulator.INPUT_RATE) {
      Log.e(LOGTAG,"String_Node_Str");
      Toast.makeText(MainActivity.this,"String_Node_Str" + Demodulator.INPUT_RATE / 1000000 + "String_Node_Str",Toast.LENGTH_LONG).show();
      scheduler.setDemodulationActivated(false);
      mode=Demodulator.DEMODULATION_OFF;
    }
 else {
      scheduler.setDemodulationActivated(true);
    }
  }
  demodulator.setDemodulationMode(mode);
  this.demodulationMode=mode;
  if (mode == Demodulator.DEMODULATION_OFF) {
    analyzerSurface.setDemodulationEnabled(false);
  }
 else {
    analyzerSurface.setDemodulationEnabled(true);
  }
  updateActionBar();
}
Program: 55020
Project: 55020
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
switch (id) {
case R.id.action_startStop:
    if (running) {
      stopAnalyzer();
      this.setDemodulationMode(Demodulator.DEMODULATION_OFF);
    }
 else     startAnalyzer();
  break;
case R.id.action_setDemodulation:
showDemodulationDialog();
break;
case R.id.action_setFrequency:
tuneToFrequency();
break;
case R.id.action_setGain:
adjustGain();
break;
case R.id.action_autoscale:
analyzerSurface.autoscale();
break;
case R.id.action_settings:
Intent intentShowSettings=new Intent(getApplicationContext(),SettingsActivity.class);
startActivity(intentShowSettings);
break;
case R.id.action_help:
Intent intentShowHelp=new Intent(Intent.ACTION_VIEW);
intentShowHelp.setData(Uri.parse(getString(R.string.help_url)));
startActivity(intentShowHelp);
break;
default :
}
return true;
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
switch (id) {
case R.id.action_startStop:
    if (running)     stopAnalyzer();
 else     startAnalyzer();
  break;
case R.id.action_setDemodulation:
showDemodulationDialog();
break;
case R.id.action_setFrequency:
tuneToFrequency();
break;
case R.id.action_setGain:
adjustGain();
break;
case R.id.action_autoscale:
analyzerSurface.autoscale();
break;
case R.id.action_settings:
Intent intentShowSettings=new Intent(getApplicationContext(),SettingsActivity.class);
startActivity(intentShowSettings);
break;
case R.id.action_help:
Intent intentShowHelp=new Intent(Intent.ACTION_VIEW);
intentShowHelp.setData(Uri.parse(getString(R.string.help_url)));
startActivity(intentShowHelp);
break;
default :
}
return true;
}
Program: 55021
Project: 55021
Buggy source:
@Override protected void onStart(){
  super.onStart();
  checkForChangedPreferences();
  if (running)   startAnalyzer();
  this.setDemodulationMode(demodulationMode);
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  checkForChangedPreferences();
  if (running)   startAnalyzer();
  if (savedInstanceState != null) {
    analyzerSurface.setVirtualFrequency(savedInstanceState.getLong(getString(R.string.save_state_virtualFrequency)));
    analyzerSurface.setVirtualSampleRate(savedInstanceState.getInt(getString(R.string.save_state_virtualSampleRate)));
    analyzerSurface.setDBScale(savedInstanceState.getFloat(getString(R.string.save_state_minDB)),savedInstanceState.getFloat(getString(R.string.save_state_maxDB)));
    analyzerSurface.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    analyzerSurface.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
    analyzerSurface.setSquelch(savedInstanceState.getFloat(getString(R.string.save_state_squelch)));
    if (demodulator != null && scheduler != null) {
      demodulator.setChannelWidth(savedInstanceState.getInt(getString(R.string.save_state_channelWidth)));
      demodulator.setSquelch(savedInstanceState.getFloat(getString(R.string.save_state_squelch)));
      scheduler.setChannelFrequency(savedInstanceState.getLong(getString(R.string.save_state_channelFrequency)));
    }
    savedInstanceState=null;
  }
}
Program: 55022
Project: 55022
Buggy source:
/** 
 * Will start the RF Analyzer. This includes creating a source (if null), open a source (if not open), starting the scheduler (which starts the source) and starting the processing loop.
 */
public void startAnalyzer(){
  this.stopAnalyzer();
  int fftSize=Integer.valueOf(preferences.getString(getString(R.string.pref_fftSize),"String_Node_Str"));
  int frameRate=Integer.valueOf(preferences.getString(getString(R.string.pref_frameRate),"String_Node_Str"));
  boolean dynamicFrameRate=preferences.getBoolean(getString(R.string.pref_dynamicFrameRate),true);
  running=true;
  if (source == null) {
    if (!this.createSource())     return;
  }
  if (!source.isOpen()) {
    if (!source.open(this,this)) {
      Toast.makeText(MainActivity.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      running=false;
      return;
    }
    return;
  }
  scheduler=new Scheduler(fftSize,source);
  analyzerProcessingLoop=new AnalyzerProcessingLoop(analyzerSurface,fftSize,scheduler.getFftOutputQueue(),scheduler.getFftInputQueue());
  if (dynamicFrameRate)   analyzerProcessingLoop.setDynamicFrameRate(true);
 else {
    analyzerProcessingLoop.setDynamicFrameRate(false);
    analyzerProcessingLoop.setFrameRate(frameRate);
  }
  scheduler.start();
  analyzerProcessingLoop.start();
  scheduler.setChannelFrequency(analyzerSurface.getChannelFrequency());
  demodulator=new Demodulator(scheduler.getDemodOutputQueue(),scheduler.getDemodInputQueue(),source.getPacketSize());
  demodulator.start();
  updateActionBar();
}

Fixed version (ground truth):
/** 
 * Will start the RF Analyzer. This includes creating a source (if null), open a source (if not open), starting the scheduler (which starts the source) and starting the processing loop.
 */
public void startAnalyzer(){
  this.stopAnalyzer();
  int fftSize=Integer.valueOf(preferences.getString(getString(R.string.pref_fftSize),"String_Node_Str"));
  int frameRate=Integer.valueOf(preferences.getString(getString(R.string.pref_frameRate),"String_Node_Str"));
  boolean dynamicFrameRate=preferences.getBoolean(getString(R.string.pref_dynamicFrameRate),true);
  running=true;
  if (source == null) {
    if (!this.createSource())     return;
  }
  if (!source.isOpen()) {
    if (!source.open(this,this)) {
      Toast.makeText(MainActivity.this,"String_Node_Str",Toast.LENGTH_LONG).show();
      running=false;
      return;
    }
    return;
  }
  scheduler=new Scheduler(fftSize,source);
  analyzerProcessingLoop=new AnalyzerProcessingLoop(analyzerSurface,fftSize,scheduler.getFftOutputQueue(),scheduler.getFftInputQueue());
  if (dynamicFrameRate)   analyzerProcessingLoop.setDynamicFrameRate(true);
 else {
    analyzerProcessingLoop.setDynamicFrameRate(false);
    analyzerProcessingLoop.setFrameRate(frameRate);
  }
  scheduler.start();
  analyzerProcessingLoop.start();
  scheduler.setChannelFrequency(analyzerSurface.getChannelFrequency());
  demodulator=new Demodulator(scheduler.getDemodOutputQueue(),scheduler.getDemodInputQueue(),source.getPacketSize());
  demodulator.start();
  this.setDemodulationMode(demodulationMode);
  updateActionBar();
}
Program: 55024
Project: 55024
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  outState.putBoolean(getString(R.string.save_state_running),running);
  outState.putInt(getString(R.string.save_state_demodulatorMode),demodulationMode);
  if (analyzerSurface != null) {
    outState.putLong(getString(R.string.save_state_virtualFrequency),analyzerSurface.getVirtualFrequency());
    outState.putInt(getString(R.string.save_state_virtualSampleRate),analyzerSurface.getVirtualSampleRate());
    outState.putFloat(getString(R.string.save_state_minDB),analyzerSurface.getMinDB());
    outState.putFloat(getString(R.string.save_state_maxDB),analyzerSurface.getMaxDB());
  }
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  outState.putBoolean(getString(R.string.save_state_running),running);
  outState.putInt(getString(R.string.save_state_demodulatorMode),demodulationMode);
  if (analyzerSurface != null) {
    outState.putLong(getString(R.string.save_state_channelFrequency),analyzerSurface.getChannelFrequency());
    outState.putInt(getString(R.string.save_state_channelWidth),analyzerSurface.getChannelWidth());
    outState.putFloat(getString(R.string.save_state_squelch),analyzerSurface.getSquelch());
    outState.putLong(getString(R.string.save_state_virtualFrequency),analyzerSurface.getVirtualFrequency());
    outState.putInt(getString(R.string.save_state_virtualSampleRate),analyzerSurface.getVirtualSampleRate());
    outState.putFloat(getString(R.string.save_state_minDB),analyzerSurface.getMinDB());
    outState.putFloat(getString(R.string.save_state_maxDB),analyzerSurface.getMaxDB());
  }
}
Program: 55025
Project: 55025
Buggy source:
@Override public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){
  if (source != null) {
    virtualFrequency=Math.min(Math.max(virtualFrequency + (long)((virtualSampleRate / width) * distanceX),source.getMinFrequency() - source.getSampleRate() / 2),source.getMaxFrequency() + source.getSampleRate() / 2);
    if (verticalScrollEnabled) {
      float yDiff=(maxDB - minDB) * (distanceY / (float)getFftHeight());
      if (maxDB - yDiff > MAX_DB)       yDiff=MAX_DB - maxDB;
      if (minDB - yDiff < MIN_DB)       yDiff=MIN_DB - minDB;
      this.setDBScale(minDB - yDiff,maxDB - yDiff);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){
  if (source != null) {
    virtualFrequency=Math.min(Math.max(virtualFrequency + (long)(((virtualSampleRate / (float)width) * distanceX)),source.getMinFrequency() - source.getSampleRate() / 2),source.getMaxFrequency() + source.getSampleRate() / 2);
    if (virtualFrequency <= 0)     virtualFrequency=1;
    if (verticalScrollEnabled) {
      float yDiff=(maxDB - minDB) * (distanceY / (float)getFftHeight());
      if (maxDB - yDiff > MAX_DB)       yDiff=MAX_DB - maxDB;
      if (minDB - yDiff < MIN_DB)       yDiff=MIN_DB - minDB;
      this.setDBScale(minDB - yDiff,maxDB - yDiff);
    }
  }
  return true;
}
Program: 55026
Project: 55026
Buggy source:
@Override public boolean onScale(ScaleGestureDetector detector){
  if (source != null) {
    float xScale=detector.getCurrentSpanX() / detector.getPreviousSpanX();
    long frequencyFocus=virtualFrequency + (int)((detector.getFocusX() / width - 0.5) * virtualSampleRate);
    virtualSampleRate=(int)Math.min(Math.max(virtualSampleRate / xScale,1),source.getMaxSampleRate());
    virtualFrequency=Math.min(Math.max(frequencyFocus + (long)((virtualFrequency - frequencyFocus) / xScale),source.getMinFrequency() - source.getSampleRate() / 2),source.getMaxFrequency() + source.getSampleRate() / 2);
    if (verticalZoomEnabled) {
      float yScale=detector.getCurrentSpanY() / detector.getPreviousSpanY();
      float dBFocus=maxDB - (maxDB - minDB) * (detector.getFocusY() / getFftHeight());
      float newMinDB=Math.min(Math.max(dBFocus - (dBFocus - minDB) / yScale,MIN_DB),MAX_DB - 10);
      float newMaxDB=Math.min(Math.max(dBFocus - (dBFocus - maxDB) / yScale,newMinDB + 10),MAX_DB);
      this.setDBScale(newMinDB,newMaxDB);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onScale(ScaleGestureDetector detector){
  if (source != null) {
    float xScale=detector.getCurrentSpanX() / detector.getPreviousSpanX();
    long frequencyFocus=virtualFrequency + (int)((detector.getFocusX() / width - 0.5) * virtualSampleRate);
    virtualSampleRate=(int)Math.min(Math.max(virtualSampleRate / xScale,MIN_VIRTUAL_SAMPLERATE),source.getMaxSampleRate());
    virtualFrequency=Math.min(Math.max(frequencyFocus + (long)((virtualFrequency - frequencyFocus) / xScale),source.getMinFrequency() - source.getSampleRate() / 2),source.getMaxFrequency() + source.getSampleRate() / 2);
    if (verticalZoomEnabled) {
      float yScale=detector.getCurrentSpanY() / detector.getPreviousSpanY();
      float dBFocus=maxDB - (maxDB - minDB) * (detector.getFocusY() / getFftHeight());
      float newMinDB=Math.min(Math.max(dBFocus - (dBFocus - minDB) / yScale,MIN_DB),MAX_DB - 10);
      float newMaxDB=Math.min(Math.max(dBFocus - (dBFocus - maxDB) / yScale,newMinDB + 10),MAX_DB);
      this.setDBScale(newMinDB,newMaxDB);
    }
  }
  return true;
}
Program: 55027
Project: 55027
Buggy source:
/** 
 * Will pop up a dialog to let the user input a new frequency.
 */
private void tuneToFrequency(){
  if (source == null)   return;
  final EditText et_input=new EditText(this);
  et_input.setInputType(InputType.TYPE_CLASS_NUMBER);
  new AlertDialog.Builder(this).setTitle("String_Node_Str").setMessage("String_Node_Str" + source.getFrequency() + "String_Node_Str").setView(et_input).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      try {
        long newFreq=Long.valueOf(et_input.getText().toString());
        source.setFrequency(newFreq);
        analyzerSurface.setVirtualFrequency(newFreq);
      }
 catch (      NumberFormatException e) {
        Log.e(LOGTAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
    }
  }
).show();
}

Fixed version (ground truth):
/** 
 * Will pop up a dialog to let the user input a new frequency.
 */
private void tuneToFrequency(){
  if (source == null)   return;
  final EditText et_input=new EditText(this);
  et_input.setInputType(InputType.TYPE_CLASS_NUMBER);
  new AlertDialog.Builder(this).setTitle("String_Node_Str").setMessage("String_Node_Str" + source.getFrequency() + "String_Node_Str").setView(et_input).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      try {
        long newFreq=Long.valueOf(et_input.getText().toString());
        if (newFreq <= source.getMaxFrequency() && newFreq >= source.getMinFrequency()) {
          source.setFrequency(newFreq);
          analyzerSurface.setVirtualFrequency(newFreq);
        }
 else {
          Toast.makeText(MainActivity.this,"String_Node_Str",Toast.LENGTH_LONG).show();
        }
      }
 catch (      NumberFormatException e) {
        Log.e(LOGTAG,"String_Node_Str" + e.getMessage());
      }
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
    }
  }
).show();
}
Program: 55028
Project: 55028
Buggy source:
@GetMapping(value={"String_Node_Str","String_Node_Str"}) public ModelAndView rootNode(@PathVariable(required=false) String version){
  final String root=getRoot();
  final List<String> versions=nodeService.listChildren(root).stream().filter(e -> !e.endsWith(COMMENT_SUFFIX)).sorted(Comparator.comparing(String::toString).reversed()).collect(Collectors.toList());
  final String theVersion=com.google.common.base.Objects.firstNonNull(version,Iterables.getFirst(versions,null));
  final ModelAndView mv=new ModelAndView("String_Node_Str");
  mv.addObject("String_Node_Str",root);
  mv.addObject("String_Node_Str",versions);
  mv.addObject("String_Node_Str",theVersion);
  if (Iterables.contains(versions,theVersion)) {
    final List<String> groups=nodeService.listChildren(makePaths(root,theVersion)).stream().sorted().collect(Collectors.toList());
    mv.addObject("String_Node_Str",groups);
  }
  return mv;
}

Fixed version (ground truth):
@GetMapping(value={"String_Node_Str","String_Node_Str"}) public ModelAndView rootNode(@PathVariable(required=false) String version){
  final String root=getRoot();
  final List<String> versions=nodeService.listChildren(root).stream().filter(e -> !e.endsWith(COMMENT_SUFFIX)).sorted(Comparator.comparing(String::toString).reversed()).collect(Collectors.toList());
  final String theVersion=version != null ? version : Iterables.getFirst(versions,null);
  final ModelAndView mv=new ModelAndView("String_Node_Str");
  mv.addObject("String_Node_Str",root);
  mv.addObject("String_Node_Str",versions);
  mv.addObject("String_Node_Str",theVersion);
  if (Iterables.contains(versions,theVersion)) {
    final List<String> groups=nodeService.listChildren(makePaths(root,theVersion)).stream().sorted().collect(Collectors.toList());
    mv.addObject("String_Node_Str",groups);
  }
  return mv;
}
Program: 55029
Project: 55029
Buggy source:
/** 
 * @param inputstream
 * @return
 * @throws IOException
 */
private List<PropertyItemVO> parseInputFile(InputStream inputstream) throws IOException {
  List<String> lines=IOUtils.readLines(inputstream,Charsets.UTF_8.name());
  List<PropertyItemVO> items=Lists.newArrayList();
  String previousLine=null;
  for (int i=1; i < lines.size(); i++) {
    String line=lines.get(i);
    if (!line.startsWith("String_Node_Str")) {
      Iterable<String> parts=PROPERTY_SPLITTER.split(line);
      if (Iterables.size(parts) == 2) {
        PropertyItemVO item=new PropertyItemVO(Iterables.getFirst(parts,null).trim(),Iterables.getLast(parts).trim());
        if (previousLine != null && previousLine.startsWith("String_Node_Str")) {
          item.setComment(StringUtils.trimLeadingCharacter(previousLine,'#').trim());
        }
        items.add(item);
      }
    }
    previousLine=line;
  }
  return items;
}

Fixed version (ground truth):
/** 
 * @param inputstream
 * @return
 * @throws IOException
 */
private List<PropertyItemVO> parseInputFile(InputStream inputstream) throws IOException {
  List<String> lines=IOUtils.readLines(inputstream,Charsets.UTF_8.name());
  List<PropertyItemVO> items=Lists.newArrayList();
  String previousLine=null;
  for (int i=0; i < lines.size(); i++) {
    String line=lines.get(i);
    if (!line.startsWith("String_Node_Str")) {
      Iterable<String> parts=PROPERTY_SPLITTER.split(line);
      if (Iterables.size(parts) == 2) {
        PropertyItemVO item=new PropertyItemVO(Iterables.getFirst(parts,null).trim(),Iterables.getLast(parts).trim());
        if (previousLine != null && previousLine.startsWith("String_Node_Str")) {
          item.setComment(StringUtils.trimLeadingCharacter(previousLine,'#').trim());
        }
        items.add(item);
      }
    }
    previousLine=line;
  }
  return items;
}
Program: 55031
Project: 55031
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem menuItem){
  if (menuItem.getItemId() == android.R.id.home) {
    if (Build.VERSION.SDK_INT < 21)     finish();
 else     finishAfterTransition();
  }
 else   if (menuItem.getItemId() == R.id.action_continue_read_progress) {
    if (isLoading) {
      Toast.makeText(NovelInfoActivity.this,getResources().getString(R.string.system_loading_please_wait),Toast.LENGTH_SHORT).show();
      return true;
    }
    final GlobalConfig.ReadSavesV1 rs=GlobalConfig.getReadSavesRecordV1(aid);
    if (rs != null) {
      showDirectJumpToReaderDialog(rs.cid);
      return true;
    }
    Toast.makeText(this,getResources().getText(R.string.reader_msg_no_saved_reading_progress),Toast.LENGTH_SHORT).show();
  }
 else   if (menuItem.getItemId() == R.id.action_go_to_forum) {
    Intent intent=new Intent(NovelInfoActivity.this,NovelReviewListActivity.class);
    intent.putExtra("String_Node_Str",aid);
    startActivity(intent);
  }
  return super.onOptionsItemSelected(menuItem);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem menuItem){
  if (menuItem.getItemId() == android.R.id.home) {
    if (Build.VERSION.SDK_INT < 21)     finish();
 else     finishAfterTransition();
  }
 else   if (menuItem.getItemId() == R.id.action_continue_read_progress) {
    if (runLoadingChecker())     return true;
    final GlobalConfig.ReadSavesV1 rs=GlobalConfig.getReadSavesRecordV1(aid);
    if (rs != null) {
      showDirectJumpToReaderDialog(rs.cid);
      return true;
    }
    Toast.makeText(this,getResources().getText(R.string.reader_msg_no_saved_reading_progress),Toast.LENGTH_SHORT).show();
  }
 else   if (menuItem.getItemId() == R.id.action_go_to_forum) {
    Intent intent=new Intent(NovelInfoActivity.this,NovelReviewListActivity.class);
    intent.putExtra("String_Node_Str",aid);
    startActivity(intent);
  }
  return super.onOptionsItemSelected(menuItem);
}
Program: 55034
Project: 55034
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.layout_vertical_reader_temp);
  aid=getIntent().getIntExtra("String_Node_Str",1);
  volumeList=(VolumeList)getIntent().getSerializableExtra("String_Node_Str");
  cid=getIntent().getIntExtra("String_Node_Str",1);
  from=getIntent().getStringExtra("String_Node_Str");
  typeface=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  getNovelContent();
  TextListLayout=(LinearLayout)VerticalReaderActivity.this.findViewById(R.id.novel_content_layout);
  Toast.makeText(this,getString(R.string.notice_volume_to_dark_mode),Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.layout_vertical_reader_temp);
  aid=getIntent().getIntExtra("String_Node_Str",1);
  volumeList=(VolumeList)getIntent().getSerializableExtra("String_Node_Str");
  cid=getIntent().getIntExtra("String_Node_Str",1);
  from=getIntent().getStringExtra("String_Node_Str");
  if (ImageLoader.getInstance() == null || !ImageLoader.getInstance().isInited()) {
    GlobalConfig.initImageLoader(this);
  }
  typeface=Typeface.createFromAsset(getAssets(),"String_Node_Str");
  getNovelContent();
  TextListLayout=(LinearLayout)VerticalReaderActivity.this.findViewById(R.id.novel_content_layout);
  Toast.makeText(this,getString(R.string.notice_volume_to_dark_mode),Toast.LENGTH_SHORT).show();
}
Program: 55035
Project: 55035
Buggy source:
@Override protected void onPostExecute(Wenku8Error.ErrorCode errorCode){
  super.onPostExecute(errorCode);
  isLoading=false;
  md.dismiss();
  if (errorCode != Wenku8Error.ErrorCode.SYSTEM_1_SUCCEEDED) {
    Toast.makeText(getActivity(),errorCode.toString(),Toast.LENGTH_SHORT).show();
  }
  AsyncLoadAllLocal alal=new AsyncLoadAllLocal();
  alal.execute();
}

Fixed version (ground truth):
@Override protected void onPostExecute(Wenku8Error.ErrorCode errorCode){
  super.onPostExecute(errorCode);
  isLoading=false;
  md.dismiss();
  if (errorCode != Wenku8Error.ErrorCode.SYSTEM_1_SUCCEEDED) {
    Toast.makeText(MyApp.getContext(),errorCode.toString(),Toast.LENGTH_SHORT).show();
  }
  AsyncLoadAllLocal alal=new AsyncLoadAllLocal();
  alal.execute();
}
Program: 55036
Project: 55036
Buggy source:
public Preference(Context context){
  this(context,null);
}

Fixed version (ground truth):
public Preference(Context context){
  super(context);
}
Program: 55039
Project: 55039
Buggy source:
public SlackSession build(){
  return new SlackWebSocketSessionImpl(provider,authToken,proxyType,proxyAddress,proxyPort,proxyUser,proxyPassword,autoreconnection,heartbeat,unit);
}

Fixed version (ground truth):
public SlackSession build(){
  return new SlackWebSocketSessionImpl(provider,authToken,proxyType,proxyAddress,proxyPort,proxyUser,proxyPassword,autoreconnection,rateLimitSupport,heartbeat,unit);
}
Program: 55040
Project: 55040
Buggy source:
public static SlackSession createWebSocketSlackSession(String authToken){
  return new SlackWebSocketSessionImpl(null,authToken,true,0,null);
}

Fixed version (ground truth):
public static SlackSession createWebSocketSlackSession(String authToken){
  return new SlackWebSocketSessionImpl(null,authToken,true,true,0,null);
}
Program: 55041
Project: 55041
Buggy source:
SlackWebSocketSessionImpl(WebSocketContainerProvider webSocketContainerProvider,String authToken,Proxy.Type proxyType,String proxyAddress,int proxyPort,String proxyUser,String proxyPassword,boolean reconnectOnDisconnection,long heartbeat,TimeUnit unit){
  this.authToken=authToken;
  if (proxyType != null && proxyType != Proxy.Type.DIRECT) {
    this.proxyAddress=proxyAddress;
    this.proxyPort=proxyPort;
    this.proxyHost=new HttpHost(proxyAddress,proxyPort);
    this.proxyUser=proxyUser;
    this.proxyPassword=proxyPassword;
  }
  this.reconnectOnDisconnection=reconnectOnDisconnection;
  this.heartbeat=heartbeat != 0 ? unit.toMillis(heartbeat) : DEFAULT_HEARTBEAT_IN_MILLIS;
  this.webSocketContainerProvider=webSocketContainerProvider != null ? webSocketContainerProvider : new DefaultWebSocketContainerProvider(this.proxyAddress,this.proxyPort,this.proxyUser,this.proxyPassword);
  addInternalListeners();
}

Fixed version (ground truth):
SlackWebSocketSessionImpl(WebSocketContainerProvider webSocketContainerProvider,String authToken,Proxy.Type proxyType,String proxyAddress,int proxyPort,String proxyUser,String proxyPassword,boolean reconnectOnDisconnection,boolean isRateLimitSupported,long heartbeat,TimeUnit unit){
  this.authToken=authToken;
  if (proxyType != null && proxyType != Proxy.Type.DIRECT) {
    this.proxyAddress=proxyAddress;
    this.proxyPort=proxyPort;
    this.proxyHost=new HttpHost(proxyAddress,proxyPort);
    this.proxyUser=proxyUser;
    this.proxyPassword=proxyPassword;
  }
  this.reconnectOnDisconnection=reconnectOnDisconnection;
  this.isRateLimitSupported=isRateLimitSupported;
  this.heartbeat=heartbeat != 0 ? unit.toMillis(heartbeat) : DEFAULT_HEARTBEAT_IN_MILLIS;
  this.webSocketContainerProvider=webSocketContainerProvider != null ? webSocketContainerProvider : new DefaultWebSocketContainerProvider(this.proxyAddress,this.proxyPort,this.proxyUser,this.proxyPassword);
  addInternalListeners();
}
Program: 55042
Project: 55042
Buggy source:
private void connectImpl() throws IOException {
  LOGGER.info("String_Node_Str");
  HttpClient httpClient=getHttpClient();
  HttpGet request=new HttpGet(SLACK_HTTPS_AUTH_URL + authToken);
  HttpResponse response;
  response=httpClient.execute(request);
  LOGGER.debug(response.getStatusLine().toString());
  String jsonResponse=consumeToString(response.getEntity().getContent());
  SlackJSONSessionStatusParser sessionParser=new SlackJSONSessionStatusParser(jsonResponse);
  sessionParser.parse();
  if (sessionParser.getError() != null) {
    LOGGER.error("String_Node_Str" + sessionParser.getError());
    throw new ConnectException(sessionParser.getError());
  }
  users=sessionParser.getUsers();
  integrations=sessionParser.getIntegrations();
  channels=sessionParser.getChannels();
  sessionPersona=sessionParser.getSessionPersona();
  team=sessionParser.getTeam();
  LOGGER.info("String_Node_Str" + team.getId() + "String_Node_Str"+ team.getName());
  LOGGER.info("String_Node_Str" + sessionPersona.getId() + "String_Node_Str"+ sessionPersona.getUserName());
  LOGGER.info(users.size() + "String_Node_Str");
  LOGGER.info(channels.size() + "String_Node_Str");
  webSocketConnectionURL=sessionParser.getWebSocketURL();
  LOGGER.debug("String_Node_Str" + webSocketConnectionURL);
  establishWebsocketConnection();
}

Fixed version (ground truth):
private void connectImpl() throws IOException {
  LOGGER.info("String_Node_Str");
  HttpClient httpClient=getHttpClient();
  HttpGet request=new HttpGet(SLACK_HTTPS_AUTH_URL + authToken);
  HttpResponse response=httpClient.execute(request);
  LOGGER.debug(response.getStatusLine().toString());
  String jsonResponse=consumeToString(response.getEntity().getContent());
  SlackJSONSessionStatusParser sessionParser=new SlackJSONSessionStatusParser(jsonResponse);
  sessionParser.parse();
  if (sessionParser.getError() != null) {
    LOGGER.error("String_Node_Str" + sessionParser.getError());
    throw new ConnectException(sessionParser.getError());
  }
  users=sessionParser.getUsers();
  integrations=sessionParser.getIntegrations();
  channels=sessionParser.getChannels();
  sessionPersona=sessionParser.getSessionPersona();
  team=sessionParser.getTeam();
  LOGGER.info("String_Node_Str" + team.getId() + "String_Node_Str"+ team.getName());
  LOGGER.info("String_Node_Str" + sessionPersona.getId() + "String_Node_Str"+ sessionPersona.getUserName());
  LOGGER.info(users.size() + "String_Node_Str");
  LOGGER.info(channels.size() + "String_Node_Str");
  webSocketConnectionURL=sessionParser.getWebSocketURL();
  LOGGER.debug("String_Node_Str" + webSocketConnectionURL);
  establishWebsocketConnection();
}