nus-yam/ex-repair huggingface dataset:
Program: 107675
Project: 107675
Buggy source:
protected void doOpen() throws ResourceUnavailableException {
  encState=new SKP_Silk_encoder_state_FLP();
  encControl=new SKP_SILK_SDK_EncControlStruct();
  if (Silk_enc_API.SKP_Silk_SDK_InitEncoder(encState,encControl) != 0)   throw new ResourceUnavailableException("String_Node_Str");
  AudioFormat inputFormat=(AudioFormat)getInputFormat();
  double sampleRate=inputFormat.getSampleRate();
  int channels=inputFormat.getChannels();
  ConfigurationService cfg=LibJitsi.getConfigurationService();
  boolean useFEC=cfg.getBoolean("String_Node_Str" + "String_Node_Str",true);
  boolean assumePacketLoss=cfg.getBoolean("String_Node_Str" + "String_Node_Str" + "String_Node_Str",true);
  String satStr=cfg.getString("String_Node_Str" + "String_Node_Str","String_Node_Str");
  float sat=Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES;
  try {
    sat=Float.parseFloat(satStr);
  }
 catch (  Exception e) {
  }
  Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES=sat;
  encControl.API_sampleRate=(int)sampleRate;
  encControl.bitRate=BITRATE;
  encControl.complexity=COMPLEXITY;
  encControl.maxInternalSampleRate=encControl.API_sampleRate;
  encControl.packetLossPercentage=assumePacketLoss ? 2 : 0;
  encControl.packetSize=(int)((JavaDecoder.FRAME_DURATION * sampleRate * channels) / 1000);
  encControl.useDTX=USE_DTX ? 1 : 0;
  encControl.useInBandFEC=useFEC ? 1 : 0;
}

Fixed version (ground truth):
protected void doOpen() throws ResourceUnavailableException {
  encState=new SKP_Silk_encoder_state_FLP();
  encControl=new SKP_SILK_SDK_EncControlStruct();
  if (Silk_enc_API.SKP_Silk_SDK_InitEncoder(encState,encControl) != 0)   throw new ResourceUnavailableException("String_Node_Str");
  AudioFormat inputFormat=(AudioFormat)getInputFormat();
  double sampleRate=inputFormat.getSampleRate();
  int channels=inputFormat.getChannels();
  ConfigurationService cfg=LibJitsi.getConfigurationService();
  boolean useFEC=cfg.getBoolean("String_Node_Str" + "String_Node_Str",true);
  boolean assumePacketLoss=cfg.getBoolean("String_Node_Str" + "String_Node_Str" + "String_Node_Str",true);
  String satStr=cfg.getString("String_Node_Str" + "String_Node_Str","String_Node_Str");
  float sat=Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES;
  try {
    sat=Float.parseFloat(satStr);
  }
 catch (  Exception e) {
  }
  Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES=sat;
  encControl.API_sampleRate=(int)sampleRate;
  encControl.bitRate=BITRATE;
  encControl.complexity=COMPLEXITY;
  encControl.maxInternalSampleRate=encControl.API_sampleRate;
  encControl.packetLossPercentage=assumePacketLoss ? 3 : 0;
  encControl.packetSize=(int)((JavaDecoder.FRAME_DURATION * sampleRate * channels) / 1000);
  encControl.useDTX=USE_DTX ? 1 : 0;
  encControl.useInBandFEC=useFEC ? 1 : 0;
}
Program: 107676
Project: 107676
Buggy source:
/** 
 * Control low bitrate redundancy usage.
 * @param psEnc Encoder state FLP.
 * @param psEncCtrl Encoder control.
 */
static void SKP_Silk_LBRR_ctrl_FLP(SKP_Silk_encoder_state_FLP psEnc,SKP_Silk_encoder_control psEncCtrl){
  int LBRR_usage;
  if (psEnc.sCmn.LBRR_enabled != 0) {
    LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
    if (psEnc.speech_activity > Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES && psEnc.sCmn.PacketLoss_perc >= Silk_define.LBRR_LOSS_THRES) {
      LBRR_usage=Silk_define.SKP_SILK_ADD_LBRR_TO_PLUS1;
    }
    psEncCtrl.LBRR_usage=LBRR_usage;
  }
 else {
    psEncCtrl.LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
  }
}

Fixed version (ground truth):
/** 
 * Control low bitrate redundancy usage.
 * @param psEnc Encoder state FLP.
 * @param psEncCtrl Encoder control.
 */
static void SKP_Silk_LBRR_ctrl_FLP(SKP_Silk_encoder_state_FLP psEnc,SKP_Silk_encoder_control psEncCtrl){
  int LBRR_usage;
  if (psEnc.sCmn.LBRR_enabled != 0) {
    LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
    if (psEnc.speech_activity > Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES && psEnc.sCmn.PacketLoss_perc > Silk_define.LBRR_LOSS_THRES) {
      LBRR_usage=Silk_define.SKP_SILK_ADD_LBRR_TO_PLUS1;
    }
    psEncCtrl.LBRR_usage=LBRR_usage;
  }
 else {
    psEncCtrl.LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
  }
}
Program: 107677
Project: 107677
Buggy source:
/** 
 * Control low bitrate redundancy usage.
 * @param psEnc Encoder state FLP.
 * @param psEncCtrl Encoder control.
 */
static void SKP_Silk_LBRR_ctrl_FLP(SKP_Silk_encoder_state_FLP psEnc,SKP_Silk_encoder_control psEncCtrl){
  int LBRR_usage;
  if (psEnc.sCmn.LBRR_enabled != 0) {
    LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
    if (psEnc.speech_activity > Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES && psEnc.sCmn.PacketLoss_perc > Silk_define.LBRR_LOSS_THRES) {
      LBRR_usage=Silk_define.SKP_SILK_ADD_LBRR_TO_PLUS1;
    }
    psEncCtrl.LBRR_usage=LBRR_usage;
  }
 else {
    psEncCtrl.LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
  }
}

Fixed version (ground truth):
/** 
 * Control low bitrate redundancy usage.
 * @param psEnc Encoder state FLP.
 * @param psEncCtrl Encoder control.
 */
static void SKP_Silk_LBRR_ctrl_FLP(SKP_Silk_encoder_state_FLP psEnc,SKP_Silk_encoder_control psEncCtrl){
  int LBRR_usage;
  if (psEnc.sCmn.LBRR_enabled != 0) {
    LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
    if (psEnc.speech_activity > Silk_define_FLP.LBRR_SPEECH_ACTIVITY_THRES && psEnc.sCmn.PacketLoss_perc >= Silk_define.LBRR_LOSS_THRES) {
      LBRR_usage=Silk_define.SKP_SILK_ADD_LBRR_TO_PLUS1;
    }
    psEncCtrl.LBRR_usage=LBRR_usage;
  }
 else {
    psEncCtrl.LBRR_usage=Silk_define.SKP_SILK_NO_LBRR;
  }
}
Program: 107678
Project: 107678
Buggy source:
/** 
 * Sets the <tt>RTPTranslator</tt> which is to forward RTP and RTCP traffic between this and other <tt>MediaStream</tt>s.
 * @param rtpTranslator the <tt>RTPTranslator</tt> which is to forward RTPand RTCP traffic between this and other <tt>MediaStream</tt>s
 */
public void setRTPTranslator(RTPTranslator rtpTranslator){
  if (this.rtpTranslator != rtpTranslator) {
    this.rtpTranslator=rtpTranslator;
  }
}

Fixed version (ground truth):
/** 
 * Sets the <tt>RTPTranslator</tt> which is to forward RTP and RTCP traffic between this and other <tt>MediaStream</tt>s.
 * @param rtpTranslator the <tt>RTPTranslator</tt> which is to forward RTPand RTCP traffic between this and other <tt>MediaStream</tt>s
 */
public void setRTPTranslator(RTPTranslator rtpTranslator){
  if (this.rtpTranslator != rtpTranslator)   this.rtpTranslator=rtpTranslator;
}
Program: 107680
Project: 107680
Buggy source:
/** 
 * Creates   {@link #fakeSendStream} if it does not exist yet and isconsidered necessary; otherwise, does nothing.
 */
private synchronized void createFakeSendStreamIfNecessary(){
  if ((fakeSendStream == null) && sendStreams.isEmpty() && (streamRTPManagers.size() > 1)) {
    Format supportedFormat=null;
    for (    StreamRTPManagerDesc s : streamRTPManagers) {
      Format[] formats=s.getFormats();
      if ((formats != null) && (formats.length > 0)) {
        for (        Format f : formats) {
          if (f != null) {
            supportedFormat=f;
            break;
          }
        }
        if (supportedFormat != null)         break;
      }
    }
    if (supportedFormat != null) {
      try {
        fakeSendStream=manager.createSendStream(new FakePushBufferDataSource(supportedFormat),0);
      }
 catch (      Throwable t) {
        if (t instanceof ThreadDeath)         throw (ThreadDeath)t;
 else {
          logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",t);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates   {@link #fakeSendStream} if it does not exist yet and isconsidered necessary; otherwise, does nothing.
 */
private synchronized void createFakeSendStreamIfNecessary(){
  if (CREATE_FAKE_SEND_STREAM_IF_NECESSARY && (fakeSendStream == null) && sendStreams.isEmpty()&& (streamRTPManagers.size() > 1)) {
    Format supportedFormat=null;
    for (    StreamRTPManagerDesc s : streamRTPManagers) {
      Format[] formats=s.getFormats();
      if ((formats != null) && (formats.length > 0)) {
        for (        Format f : formats) {
          if (f != null) {
            supportedFormat=f;
            break;
          }
        }
        if (supportedFormat != null)         break;
      }
    }
    if (supportedFormat != null) {
      try {
        fakeSendStream=manager.createSendStream(new FakePushBufferDataSource(supportedFormat),0);
      }
 catch (      Throwable t) {
        if (t instanceof ThreadDeath)         throw (ThreadDeath)t;
 else {
          logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",t);
        }
      }
    }
  }
}
Program: 107681
Project: 107681
Buggy source:
public synchronized void dispose(StreamRTPManager streamRTPManager){
  Iterator<StreamRTPManagerDesc> streamRTPManagerIter=streamRTPManagers.iterator();
  while (streamRTPManagerIter.hasNext()) {
    StreamRTPManagerDesc streamRTPManagerDesc=streamRTPManagerIter.next();
    if (streamRTPManagerDesc.streamRTPManager == streamRTPManager) {
      RTPConnectorDesc connectorDesc=streamRTPManagerDesc.connectorDesc;
      if (connectorDesc != null) {
        if (this.connector != null) {
          this.connector.removeConnector(connectorDesc);
          connectorDesc.connector.close();
        }
        streamRTPManagerDesc.connectorDesc=null;
      }
      streamRTPManagerIter.remove();
      break;
    }
  }
}

Fixed version (ground truth):
public synchronized void dispose(StreamRTPManager streamRTPManager){
  Iterator<StreamRTPManagerDesc> streamRTPManagerIter=streamRTPManagers.iterator();
  while (streamRTPManagerIter.hasNext()) {
    StreamRTPManagerDesc streamRTPManagerDesc=streamRTPManagerIter.next();
    if (streamRTPManagerDesc.streamRTPManager == streamRTPManager) {
      RTPConnectorDesc connectorDesc=streamRTPManagerDesc.connectorDesc;
      if (connectorDesc != null) {
        if (this.connector != null) {
          this.connector.removeConnector(connectorDesc);
          connectorDesc.connector.close();
        }
        streamRTPManagerDesc.connectorDesc=null;
      }
      streamRTPManagerIter.remove();
      closeFakeSendStreamIfNotNecessary();
      break;
    }
  }
}
Program: 107682
Project: 107682
Buggy source:
public synchronized SendStream createSendStream(StreamRTPManager streamRTPManager,DataSource dataSource,int streamIndex) throws IOException, UnsupportedFormatException {
  SendStreamDesc sendStreamDesc=null;
  for (  SendStreamDesc s : sendStreams)   if ((s.dataSource == dataSource) && (s.streamIndex == streamIndex)) {
    sendStreamDesc=s;
    break;
  }
  if (sendStreamDesc == null) {
    SendStream sendStream=manager.createSendStream(dataSource,streamIndex);
    if (sendStream != null) {
      sendStreamDesc=new SendStreamDesc(dataSource,streamIndex,sendStream);
      sendStreams.add(sendStreamDesc);
    }
  }
  return (sendStreamDesc == null) ? null : sendStreamDesc.getSendStream(streamRTPManager,true);
}

Fixed version (ground truth):
public synchronized SendStream createSendStream(StreamRTPManager streamRTPManager,DataSource dataSource,int streamIndex) throws IOException, UnsupportedFormatException {
  SendStreamDesc sendStreamDesc=null;
  for (  SendStreamDesc s : sendStreams)   if ((s.dataSource == dataSource) && (s.streamIndex == streamIndex)) {
    sendStreamDesc=s;
    break;
  }
  if (sendStreamDesc == null) {
    SendStream sendStream=manager.createSendStream(dataSource,streamIndex);
    if (sendStream != null) {
      sendStreamDesc=new SendStreamDesc(dataSource,streamIndex,sendStream);
      sendStreams.add(sendStreamDesc);
      closeFakeSendStreamIfNotNecessary();
    }
  }
  return (sendStreamDesc == null) ? null : sendStreamDesc.getSendStream(streamRTPManager,true);
}
Program: 107683
Project: 107683
Buggy source:
private boolean onPostPreferenceCheck(String key){
  if (key.equals(Settings.PREFERENCE_CPUUSAGE) || key.equals(Settings.PREFERENCE_SHORTCUT)) {
    CheckBoxPreference autoStart=(CheckBoxPreference)getPreferenceScreen().findPreference(Settings.PREFERENCE_AUTOSTART);
    if (helper.getBoolean(Settings.PREFERENCE_CPUUSAGE,false) || helper.getBoolean(Settings.PREFERENCE_SHORTCUT,false)) {
      autoStart.setEnabled(true);
    }
 else {
      autoStart.setEnabled(false);
    }
  }
  if (key.equals(Settings.PREFERENCE_CPUUSAGE) || key.equals(Settings.PREFERENCE_COLOR) || key.equals(Settings.PREFERENCE_ROOT)|| key.equals(Settings.PREFERENCE_TEMPVALUE)|| key.equals(Settings.PREFERENCE_SHORTCUT)|| key.equals(Settings.PREFERENCE_NOTIFICATION_COLOR)|| key.equals(Settings.PREFERENCE_NOTIFICATION_TOP)|| key.equals(Settings.PREFERENCE_NOTIFICATION_CUSTOMIZE)) {
    if (!key.equals(Settings.PREFERENCE_CPUUSAGE) && !key.equals(Settings.PREFERENCE_SHORTCUT)) {
      helper.setString(Settings.SESSION_SECTION,"String_Node_Str");
    }
    getApplication().stopService(new Intent(getApplication(),OSMonitorService.class));
    if (helper.getBoolean(Settings.PREFERENCE_CPUUSAGE,false) || helper.getBoolean(Settings.PREFERENCE_SHORTCUT,false)) {
      getApplication().startService(new Intent(getApplication(),OSMonitorService.class));
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean onPostPreferenceCheck(String key){
  if (key.equals(Settings.PREFERENCE_CPUUSAGE) || key.equals(Settings.PREFERENCE_SHORTCUT)) {
    CheckBoxPreference autoStart=(CheckBoxPreference)getPreferenceScreen().findPreference(Settings.PREFERENCE_AUTOSTART);
    if (helper.getBoolean(Settings.PREFERENCE_CPUUSAGE,false) || helper.getBoolean(Settings.PREFERENCE_SHORTCUT,false)) {
      autoStart.setEnabled(true);
    }
 else {
      autoStart.setEnabled(false);
    }
  }
  if (key.equals(Settings.PREFERENCE_CPUUSAGE) || key.equals(Settings.PREFERENCE_COLOR) || key.equals(Settings.PREFERENCE_ROOT)|| key.equals(Settings.PREFERENCE_TEMPVALUE)|| key.equals(Settings.PREFERENCE_SHORTCUT)|| key.equals(Settings.PREFERENCE_NOTIFICATION_COLOR)|| key.equals(Settings.PREFERENCE_NOTIFICATION_TOP)|| key.equals(Settings.PREFERENCE_NOTIFICATION_CUSTOMIZE)) {
    helper.setString(Settings.SESSION_SECTION,"String_Node_Str");
    getApplication().stopService(new Intent(getApplication(),OSMonitorService.class));
    if (helper.getBoolean(Settings.PREFERENCE_CPUUSAGE,false) || helper.getBoolean(Settings.PREFERENCE_SHORTCUT,false)) {
      getApplication().startService(new Intent(getApplication(),OSMonitorService.class));
    }
  }
  return true;
}
Program: 107684
Project: 107684
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  IpcService.Initialize(this);
  setContentView(R.layout.ui_main);
  mViewPager=(ViewPager)findViewById(R.id.mainpager);
  mViewPager.setAdapter(new OSMonitorPagerAdapter(getSupportFragmentManager()));
  mViewPager.setOnPageChangeListener(this);
  final ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayShowTitleEnabled(false);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_process_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_connection_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_misc_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_debug_tab).setTabListener(this));
  mViewPager.setCurrentItem(0);
  final Settings setting=Settings.getInstance(this);
  if ((setting.isEnableCPUMeter() || setting.isAddShortCut()) && !CommonUtil.isServiceRunning(this))   startService(new Intent(this,OSMonitorService.class));
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  IpcService.Initialize(this);
  setContentView(R.layout.ui_main);
  mViewPager=(ViewPager)findViewById(R.id.mainpager);
  mViewPager.setAdapter(new OSMonitorPagerAdapter(getSupportFragmentManager()));
  mViewPager.setOnPageChangeListener(this);
  mViewPager.setOffscreenPageLimit(5);
  final ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayShowTitleEnabled(false);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_process_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_connection_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_misc_tab).setTabListener(this));
  actionBar.addTab(actionBar.newTab().setText(R.string.ui_debug_tab).setTabListener(this));
  mViewPager.setCurrentItem(0);
  final Settings setting=Settings.getInstance(this);
  if ((setting.isEnableCPUMeter() || setting.isAddShortCut()) && !CommonUtil.isServiceRunning(this))   startService(new Intent(this,OSMonitorService.class));
}
Program: 107685
Project: 107685
Buggy source:
@Override public void onTabSelected(Tab tab,FragmentTransaction ft){
  mViewPager.setCurrentItem(tab.getPosition());
}

Fixed version (ground truth):
@Override public void onTabSelected(Tab tab,FragmentTransaction ft){
  mViewPager.setCurrentItem(tab.getPosition());
  if (mViewPager.getCurrentItem() != tab.getPosition())   mViewPager.setCurrentItem(tab.getPosition());
  ((OSMonitorPagerAdapter)mViewPager.getAdapter()).getItem(mViewPager.getCurrentItem()).setMenuVisibility(true);
}
Program: 107686
Project: 107686
Buggy source:
@Override public void onTabUnselected(Tab tab,FragmentTransaction ft){
}

Fixed version (ground truth):
@Override public void onTabUnselected(Tab tab,FragmentTransaction ft){
  ((OSMonitorPagerAdapter)mViewPager.getAdapter()).getItem(tab.getPosition()).setMenuVisibility(false);
}
Program: 107687
Project: 107687
Buggy source:
@Override public void onItemSelected(AdapterView<?> parent,View view,int position,long id){
switch (position) {
case 0:
    selectedType=ipcAction.LOGCAT_MAIN;
  break;
case 1:
selectedType=ipcAction.LOGCAT_SYSTEM;
break;
case 2:
selectedType=ipcAction.LOGCAT_EVENT;
break;
case 3:
selectedType=ipcAction.DMESG;
break;
}
((TextView)parent.getChildAt(0)).setTextColor(Color.WHITE);
if (stopUpdate == true) stopButton.performClick();
forceRefresh();
if (!stopUpdate) stopUpdate=false;
}

Fixed version (ground truth):
@Override public void onItemSelected(AdapterView<?> parent,View view,int position,long id){
switch (position) {
case 0:
    selectedType=ipcAction.LOGCAT_MAIN;
  break;
case 1:
selectedType=ipcAction.LOGCAT_SYSTEM;
break;
case 2:
selectedType=ipcAction.LOGCAT_EVENT;
break;
case 3:
selectedType=ipcAction.DMESG;
break;
}
if (parent.getChildAt(0) != null) ((TextView)parent.getChildAt(0)).setTextColor(Color.WHITE);
if (stopUpdate == true) stopButton.performClick();
forceRefresh();
if (!stopUpdate) stopUpdate=false;
}
Program: 107689
Project: 107689
Buggy source:
/** 
 * execute osmcore as a binary execute
 * @param context
 * @throws InterruptedException 
 */
public static boolean execCore(Context context){
  if (context == null)   return false;
  String binary=context.getFilesDir().getAbsolutePath() + "String_Node_Str" + binaryName;
  if (!copyFile("String_Node_Str",binary,context))   return false;
  File file=new File(binary + "String_Node_Str");
  FileChannel channel=null;
  FileLock lock=null;
  try {
    channel=new RandomAccessFile(file,"String_Node_Str").getChannel();
    lock=channel.tryLock();
  }
 catch (  Exception e) {
    return false;
  }
  try {
    final Settings settings=Settings.getInstance(context);
    Process process=null;
    if (!settings.isRoot())     process=Runtime.getRuntime().exec("String_Node_Str");
 else     process=Runtime.getRuntime().exec("String_Node_Str");
    DataOutputStream os=new DataOutputStream(process.getOutputStream());
    os.writeBytes("String_Node_Str" + binary + "String_Node_Str");
    if (!settings.isRoot()) {
      os.writeBytes(binary + "String_Node_Str" + settings.getToken().toString()+ "String_Node_Str");
      os.writeBytes("String_Node_Str");
      process.waitFor();
    }
 else {
      os.writeBytes(binary + "String_Node_Str" + settings.getToken().toString()+ "String_Node_Str");
    }
  }
 catch (  Exception e) {
    return false;
  }
  try {
    lock.release();
    channel.close();
  }
 catch (  Exception e) {
  }
  return true;
}

Fixed version (ground truth):
/** 
 * execute osmcore as a binary execute
 * @param context
 * @throws InterruptedException 
 */
public static boolean execCore(Context context){
  if (context == null)   return false;
  String binary=context.getFilesDir().getAbsolutePath() + "String_Node_Str" + binaryName;
  if (!copyFile("String_Node_Str",binary,context))   return false;
  File file=new File(binary + "String_Node_Str");
  FileChannel channel=null;
  FileLock lock=null;
  try {
    channel=new RandomAccessFile(file,"String_Node_Str").getChannel();
    lock=channel.tryLock();
  }
 catch (  Exception e) {
    return false;
  }
  try {
    final Settings settings=Settings.getInstance(context);
    Process process=null;
    if (!settings.isRoot())     process=Runtime.getRuntime().exec("String_Node_Str");
 else     process=Runtime.getRuntime().exec("String_Node_Str");
    DataOutputStream os=new DataOutputStream(process.getOutputStream());
    os.writeBytes("String_Node_Str" + binary + "String_Node_Str");
    if (isCyanogenMod() && isKitKat() && settings.isRoot()) {
      os.writeBytes(binary + "String_Node_Str" + settings.getToken().toString()+ "String_Node_Str");
      Thread.sleep(500);
      process.destroy();
    }
 else {
      os.writeBytes(binary + "String_Node_Str" + settings.getToken().toString()+ "String_Node_Str");
      os.writeBytes("String_Node_Str");
      process.waitFor();
    }
  }
 catch (  Exception e) {
    return false;
  }
  try {
    lock.release();
    channel.close();
  }
 catch (  Exception e) {
  }
  return true;
}
Program: 107691
Project: 107691
Buggy source:
@Override public void run(){
  boolean cleanAfter=false;
  UartConfig tmpUartConfig=new UartConfig();
  if (mSerial == null) {
    mSerial=new AutoCommunicator().getSerialCommunicator(mContext);
    if (!mSerial.open()) {
      if (mCallBack != null) {
        mCallBack.onError(UploadErrors.OPEN_DEVICE);
      }
      mBoard=null;
      mFilePath=null;
      mCallBack=null;
      mUploader=null;
      mSerial=null;
      return;
    }
 else {
      cleanAfter=true;
    }
  }
 else {
synchronized (mSerial) {
      tmpUartConfig=mSerial.getUartConfig();
    }
  }
synchronized (mSerial) {
    mUploader.upload(mFilePath,mBoard,mSerial,mCallBack);
    mSerial.setUartConfig(tmpUartConfig);
    if (cleanAfter) {
      mSerial.close();
      mSerial=null;
    }
  }
  mBoard=null;
  mFilePath=null;
  mCallBack=null;
  mUploader=null;
}

Fixed version (ground truth):
@Override public void run(){
  boolean cleanAfter=false;
  UartConfig tmpUartConfig=new UartConfig();
  if (mSerial == null) {
    mSerial=new AutoCommunicator().getSerialCommunicator(mContext);
    if (!mSerial.open()) {
      if (mCallBack != null) {
        mCallBack.onError(UploadErrors.OPEN_DEVICE);
      }
      mBoard=null;
      mFilePath=null;
      mCallBack=null;
      mUploader=null;
      mSerial=null;
      return;
    }
 else {
      cleanAfter=true;
    }
  }
 else {
synchronized (mSerial) {
      UartConfig origUartConfig=mSerial.getUartConfig();
      tmpUartConfig.baudrate=origUartConfig.baudrate;
      tmpUartConfig.dataBits=origUartConfig.dataBits;
      tmpUartConfig.stopBits=origUartConfig.stopBits;
      tmpUartConfig.parity=origUartConfig.parity;
      tmpUartConfig.dtrOn=origUartConfig.dtrOn;
      tmpUartConfig.rtsOn=origUartConfig.rtsOn;
    }
  }
synchronized (mSerial) {
    mSerial.clearBuffer();
    mUploader.upload(mFilePath,mBoard,mSerial,mCallBack);
    mSerial.setUartConfig(tmpUartConfig);
    mSerial.clearBuffer();
    if (cleanAfter) {
      mSerial.close();
      mSerial=null;
    }
  }
  mBoard=null;
  mFilePath=null;
  mCallBack=null;
  mUploader=null;
}
Program: 107692
Project: 107692
Buggy source:
public boolean open(UsbVidPid ids){
  if (mUsbConnetionManager.open(ids)) {
    mConnection=mUsbConnetionManager.getConnection();
    mEndpointIn=mUsbConnetionManager.getEndpointIn();
    mEndpointOut=mUsbConnetionManager.getEndpointOut();
    if (!init()) {
      return false;
    }
    if (!setBaudrate(DEFAULT_BAUDRATE)) {
      return false;
    }
    startRead();
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean open(UsbVidPid ids){
  if (mUsbConnetionManager.open(ids)) {
    mConnection=mUsbConnetionManager.getConnection();
    mEndpointIn=mUsbConnetionManager.getEndpointIn();
    mEndpointOut=mUsbConnetionManager.getEndpointOut();
    if (!init()) {
      return false;
    }
    if (!setBaudrate(DEFAULT_BAUDRATE)) {
      return false;
    }
    mBuffer.clear();
    startRead();
    return true;
  }
  return false;
}
Program: 107694
Project: 107694
Buggy source:
/** 
 * Gets ring buffer size
 * @return ring buffer size
 */
public int getRingBufferSize(){
  return mRingBufSize;
}

Fixed version (ground truth):
/** 
 * Gets ring buffer size
 * @return ring buffer size
 */
public int getRingBufferSize(){
  return mRingBufSize - 1;
}
Program: 107695
Project: 107695
Buggy source:
/** 
 * Gets buffered length
 * @return buffered length
 */
public int getBufferdLength(){
  if (mAddOffset >= mGetOffset) {
    return mAddOffset - mGetOffset;
  }
 else {
    return mAddOffset + (mRingBufSize - mGetOffset);
  }
}

Fixed version (ground truth):
/** 
 * Gets buffered length
 * @return buffered length
 */
public int getBufferdLength(){
  if (mAddIndex >= mGetIndex) {
    return mAddIndex - mGetIndex;
  }
 else {
    return mAddIndex + (mRingBufSize - mGetIndex);
  }
}
Program: 107697
Project: 107697
Buggy source:
/** 
 * Clear ring buffer
 */
public synchronized void clear(){
  mAddOffset=0;
  mGetOffset=0;
}

Fixed version (ground truth):
/** 
 * Clear ring buffer
 */
public synchronized void clear(){
  mAddIndex=0;
  mGetIndex=0;
}
Program: 107698
Project: 107698
Buggy source:
/** 
 * Ring buffer
 * @param bufferSize buffer size. It needs enough size e.g.1024
 */
public RingBuffer(int bufferSize){
  mRingBufSize=bufferSize;
  mRingBuf=new byte[mRingBufSize];
  mAddOffset=0;
  mGetOffset=0;
}

Fixed version (ground truth):
/** 
 * Ring buffer
 * @param bufferSize buffer size. It needs enough size e.g.1024
 */
public RingBuffer(int bufferSize){
  mRingBufSize=bufferSize + 1;
  mRingBuf=new byte[mRingBufSize];
  mAddIndex=0;
  mGetIndex=0;
}
Program: 107699
Project: 107699
Buggy source:
@Override public Thread newThread(Runnable runnable){
  thread=new EventThread(runnable);
  thread.setName("String_Node_Str");
  return thread;
}

Fixed version (ground truth):
@Override public Thread newThread(Runnable runnable){
  thread=new EventThread(runnable);
  thread.setName("String_Node_Str");
  thread.setDaemon(Thread.currentThread().isDaemon());
  return thread;
}
Program: 107700
Project: 107700
Buggy source:
public static Map<String,String> jsonToMap(JSONObject data) throws JSONException {
  @SuppressWarnings("String_Node_Str") Iterator<String> keys=data.keys();
  Map<String,String> result=new HashMap<String,String>();
  while (keys.hasNext()) {
    String key=keys.next();
    result.put(keys.next(),data.getString(key));
  }
  return result;
}

Fixed version (ground truth):
public static Map<String,String> jsonToMap(JSONObject data) throws JSONException {
  @SuppressWarnings("String_Node_Str") Iterator<String> keys=data.keys();
  Map<String,String> result=new HashMap<String,String>();
  while (keys.hasNext()) {
    String key=keys.next();
    result.put(key,data.getString(key));
  }
  return result;
}
Program: 107701
Project: 107701
Buggy source:
private Draft getDraft(String protocol,CallbackContext callbackContext){
  Draft draft=new Draft_10();
  if (protocol != null) {
    String draftName=draftMap.get(protocol);
    if (draftName != null) {
      try {
        Class<?> clazz=Class.forName(draftName);
        Constructor<?> ctor=clazz.getConstructor();
        draft=(Draft)ctor.newInstance();
      }
 catch (      Exception e) {
        callbackContext.error("String_Node_Str");
      }
    }
  }
  return draft;
}

Fixed version (ground truth):
private Draft getDraft(String protocol,CallbackContext callbackContext){
  Draft draft=new Draft_10();
  if (protocol != "String_Node_Str") {
    String draftName=draftMap.get(protocol);
    if (draftName != null) {
      try {
        Class<?> clazz=Class.forName(draftName);
        Constructor<?> ctor=clazz.getConstructor();
        draft=(Draft)ctor.newInstance();
      }
 catch (      Exception e) {
        callbackContext.error("String_Node_Str");
      }
    }
  }
  return draft;
}
Program: 107702
Project: 107702
Buggy source:
/** 
 * Checks if filters match request parameters.
 * @param url Request URL
 * @param query Request query string
 * @param referrer Request referrer header
 * @param accept Request accept header
 * @return true if matched filter was found
 * @throws Exception
 */
public boolean matches(String url,String query,String referrer,String accept){
  if (referrer != null)   referrerMapping.put(url,referrer);
  if (!filteringEnabled)   return false;
  String contentType=null;
  if (accept != null) {
    if (accept.contains("String_Node_Str"))     contentType="String_Node_Str";
 else     if (accept.contains("String_Node_Str"))     contentType="String_Node_Str";
  }
  if (contentType == null) {
    if (RE_JS.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_CSS.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_IMAGE.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_FONT.matcher(url).matches())     contentType="String_Node_Str";
  }
  if (contentType == null)   contentType="String_Node_Str";
  if (!"String_Node_Str".equals(query))   url=url + "String_Node_Str" + query;
  final List<String> referrerChain=buildReferrerChain(referrer);
  Log.d("String_Node_Str",url + "String_Node_Str" + referrerChain.toString());
  String[] referrerChainArray=referrerChain.toArray(new String[referrerChain.size()]);
  return abpEngine.matches(url,contentType,referrerChainArray);
}

Fixed version (ground truth):
/** 
 * Checks if filters match request parameters.
 * @param url Request URL
 * @param query Request query string
 * @param referrer Request referrer header
 * @param accept Request accept header
 * @return true if matched filter was found
 * @throws Exception
 */
public boolean matches(String url,String query,String referrer,String accept){
  final String fullUrl=!"String_Node_Str".equals(query) ? url + "String_Node_Str" + query : url;
  if (referrer != null)   referrerMapping.put(fullUrl,referrer);
  if (!filteringEnabled)   return false;
  String contentType=null;
  if (accept != null) {
    if (accept.contains("String_Node_Str"))     contentType="String_Node_Str";
 else     if (accept.contains("String_Node_Str"))     contentType="String_Node_Str";
 else     if (accept.contains("String_Node_Str"))     contentType="String_Node_Str";
  }
  if (contentType == null) {
    if (RE_JS.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_CSS.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_IMAGE.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_FONT.matcher(url).matches())     contentType="String_Node_Str";
 else     if (RE_HTML.matcher(url).matches())     contentType="String_Node_Str";
  }
  if (contentType == null)   contentType="String_Node_Str";
  final List<String> referrerChain=buildReferrerChain(referrer);
  Log.d("String_Node_Str",fullUrl + "String_Node_Str" + referrerChain.toString());
  String[] referrerChainArray=referrerChain.toArray(new String[referrerChain.size()]);
  return abpEngine.matches(fullUrl,contentType,referrerChainArray);
}
Program: 107703
Project: 107703
Buggy source:
private List<String> buildReferrerChain(String url){
  final List<String> referrerChain=new ArrayList<String>();
  final int maxChainLength=10;
  for (int i=0; i < maxChainLength && url != null; i++) {
    referrerChain.add(url);
    url=referrerMapping.get(url);
  }
  return referrerChain;
}

Fixed version (ground truth):
private List<String> buildReferrerChain(String url){
  final List<String> referrerChain=new ArrayList<String>();
  final int maxChainLength=10;
  for (int i=0; i < maxChainLength && url != null; i++) {
    referrerChain.add(0,url);
    url=referrerMapping.get(url);
  }
  return referrerChain;
}
Program: 107704
Project: 107704
Buggy source:
@Override public void onReceive(Context ctx,Intent intent){
  String action=intent.getAction();
  Log.i(TAG,"String_Node_Str" + action);
  if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
    NetworkInfo info=intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
    if (info == null)     return;
    String typeName=info.getTypeName();
    String subtypeName=info.getSubtypeName();
    boolean available=info.isAvailable();
    Log.i(TAG,"String_Node_Str" + typeName + "String_Node_Str"+ subtypeName+ "String_Node_Str"+ available);
    if (info.getType() == ConnectivityManager.TYPE_WIFI)     ProxySettings.setConnectionProxy(getApplicationContext(),LOCALHOST,port,"String_Node_Str");
  }
 else   if ("String_Node_Str".equals(action)) {
    Object lp=intent.getParcelableExtra("String_Node_Str");
    Method method;
    try {
      method=lp.getClass().getMethod("String_Node_Str");
      Object pp=method.invoke(lp);
      String[] userProxy=ProxySettings.getUserProxy(pp);
      if (userProxy != null && Integer.valueOf(userProxy[1]) != port) {
        Log.i(TAG,"String_Node_Str" + userProxy[0] + "String_Node_Str"+ userProxy[1]+ "String_Node_Str"+ userProxy[2]+ "String_Node_Str");
        if (proxy != null) {
          configureUserProxy(proxyConfiguration,userProxy[0],userProxy[1],userProxy[2],null,null);
          proxy.restart(proxyConfiguration.getProperty("String_Node_Str"));
        }
      }
    }
 catch (    Exception e) {
      Log.e(TAG,null,e);
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context ctx,Intent intent){
  String action=intent.getAction();
  Log.i(TAG,"String_Node_Str" + action);
  if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
    ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo info=connectivityManager.getActiveNetworkInfo();
    if (info == null)     return;
    String typeName=info.getTypeName();
    String subtypeName=info.getSubtypeName();
    boolean available=info.isAvailable();
    Log.i(TAG,"String_Node_Str" + typeName + "String_Node_Str"+ subtypeName+ "String_Node_Str"+ available);
    if (info.getType() == ConnectivityManager.TYPE_WIFI)     ProxySettings.setConnectionProxy(getApplicationContext(),LOCALHOST,port,"String_Node_Str");
  }
 else   if ("String_Node_Str".equals(action)) {
    Object lp=intent.getParcelableExtra("String_Node_Str");
    Method method;
    try {
      method=lp.getClass().getMethod("String_Node_Str");
      Object pp=method.invoke(lp);
      String[] userProxy=ProxySettings.getUserProxy(pp);
      if (userProxy != null && Integer.valueOf(userProxy[1]) != port) {
        Log.i(TAG,"String_Node_Str" + userProxy[0] + "String_Node_Str"+ userProxy[1]+ "String_Node_Str"+ userProxy[2]+ "String_Node_Str");
        if (proxy != null) {
          configureUserProxy(proxyConfiguration,userProxy[0],userProxy[1],userProxy[2],null,null);
          proxy.restart(proxyConfiguration.getProperty("String_Node_Str"));
        }
      }
    }
 catch (    Exception e) {
      Log.e(TAG,null,e);
    }
  }
}
Program: 107705
Project: 107705
Buggy source:
private void writeChunk(byte buffer[],int offset,int length) throws IOException {
  writeHex(length);
  if (length != 0)   out.write(buffer,offset,length);
  out.write(CRLF);
  out.flush();
}

Fixed version (ground truth):
private void writeChunk(byte buffer[],int offset,int length) throws IOException {
  if (length > 0) {
    writeHex(length);
    out.write(buffer,offset,length);
    out.write(CRLF);
    out.flush();
  }
}
Program: 107708
Project: 107708
Buggy source:
private void configureUserProxy(Properties config,String proxyHost,String proxyPort,String proxyExcl,String proxyUser,String proxyPass){
  if ("String_Node_Str".equals(proxyHost))   proxyHost=null;
  if (proxyHost != null) {
    config.put("String_Node_Str",proxyHost);
    if (!isTransparent)     config.put("String_Node_Str",proxyHost);
  }
 else {
    config.remove("String_Node_Str");
    if (!isTransparent)     config.remove("String_Node_Str");
  }
  int p=0;
  if (proxyPort == null)   proxyPort="String_Node_Str";
  try {
    p=Integer.valueOf(proxyPort);
  }
 catch (  NumberFormatException e) {
  }
  if (p == 0 || isLocalHost(proxyHost) && (p == port || p == 8080))   return;
  config.put("String_Node_Str",proxyPort);
  if (proxyExcl != null)   config.put("String_Node_Str",proxyExcl);
 else   config.remove("String_Node_Str");
  if (!isTransparent)   config.put("String_Node_Str",proxyPort);
  if (proxyUser != null && !"String_Node_Str".equals(proxyUser) && proxyPass != null && !"String_Node_Str".equals(proxyPass)) {
    String proxyAuth="String_Node_Str" + new String(Base64.encode(proxyUser + "String_Node_Str" + proxyPass));
    config.put("String_Node_Str",proxyAuth);
    if (!isTransparent)     config.put("String_Node_Str",proxyAuth);
  }
 else {
    config.remove("String_Node_Str");
    if (!isTransparent)     config.remove("String_Node_Str");
  }
}

Fixed version (ground truth):
private void configureUserProxy(Properties config,String proxyHost,String proxyPort,String proxyExcl,String proxyUser,String proxyPass){
  config.remove("String_Node_Str");
  config.remove("String_Node_Str");
  config.remove("String_Node_Str");
  config.remove("String_Node_Str");
  if (!isTransparent) {
    config.remove("String_Node_Str");
    config.remove("String_Node_Str");
    config.remove("String_Node_Str");
  }
  if (proxyHost == null || "String_Node_Str".equals(proxyHost))   return;
  int p=0;
  if (proxyPort == null)   return;
  try {
    p=Integer.valueOf(proxyPort);
  }
 catch (  NumberFormatException e) {
    return;
  }
  if (p == 0 || isLocalHost(proxyHost) && (p == port || p == 8080))   return;
  config.put("String_Node_Str",proxyHost);
  config.put("String_Node_Str",proxyPort);
  if (!isTransparent) {
    config.put("String_Node_Str",proxyHost);
    config.put("String_Node_Str",proxyPort);
  }
  if (proxyExcl != null)   config.put("String_Node_Str",proxyExcl);
  if (proxyUser != null && !"String_Node_Str".equals(proxyUser) && proxyPass != null && !"String_Node_Str".equals(proxyPass)) {
    String proxyAuth="String_Node_Str" + new String(Base64.encode(proxyUser + "String_Node_Str" + proxyPass));
    config.put("String_Node_Str",proxyAuth);
    if (!isTransparent)     config.put("String_Node_Str",proxyAuth);
  }
}
Program: 107709
Project: 107709
Buggy source:
/** 
 * PmdValidator forbids usage of Files.createFile in tests.
 * @throws Exception If something wrong happens inside.
 */
@Test public void forbidsFilesCreateFileInTests() throws Exception {
  new PmdAssert("String_Node_Str",Matchers.is(false),Matchers.containsString(PmdValidatorTest.FILES_CREATE_ERROR)).validate();
}

Fixed version (ground truth):
/** 
 * PmdValidator forbids usage of Files.createFile in tests.
 * @throws Exception If something wrong happens inside.
 */
@Test public void forbidsFilesCreateFileInTests() throws Exception {
  new PmdAssert("String_Node_Str",Matchers.is(false),Matchers.containsString(PmdValidatorTest.FILES_CREATE_ERR)).validate();
}
Program: 107710
Project: 107710
Buggy source:
/** 
 * PmdValidator allows usage of Files.createFile outside of tests.
 * @throws Exception If something wrong happens inside.
 */
@Test public void forbidsFilesCreateFileOutsideOfTests() throws Exception {
  new PmdAssert("String_Node_Str",Matchers.is(true),Matchers.not(Matchers.containsString(PmdValidatorTest.FILES_CREATE_ERROR))).validate();
}

Fixed version (ground truth):
/** 
 * PmdValidator allows usage of Files.createFile outside of tests.
 * @throws Exception If something wrong happens inside.
 */
@Test public void forbidsFilesCreateFileOutsideOfTests() throws Exception {
  new PmdAssert("String_Node_Str",Matchers.is(true),Matchers.not(Matchers.containsString(PmdValidatorTest.FILES_CREATE_ERR))).validate();
}
Program: 107711
Project: 107711
Buggy source:
/** 
 * Check that non static class method refer   {@code this}. Methods that are   {@code native},   {@code abstract} or annotated with {@code @Override}are excluded.  Additionally, if the method only throws an exception, it too is excluded.
 * @param method DetailAST of method
 */
private void checkClassMethod(final DetailAST method){
  final DetailAST modifiers=method.findFirstToken(TokenTypes.MODIFIERS);
  if (modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
    return;
  }
  final boolean onlythrow=method.branchContains(TokenTypes.LITERAL_THROW) && this.getMethodLength(method) == ONLY_THROW_LEN;
  if (!AnnotationUtility.containsAnnotation(method,"String_Node_Str") && !isInAbstractOrNativeMethod(method) && !method.branchContains(TokenTypes.LITERAL_THIS)&& !onlythrow) {
    final int line=method.getLineNo();
    this.log(line,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Check that non static class method refer   {@code this}. Methods that are   {@code native},   {@code abstract} or annotated with {@code @Override}are excluded.  Additionally, if the method only throws an exception, it too is excluded.
 * @param method DetailAST of method
 */
private void checkClassMethod(final DetailAST method){
  final DetailAST modifiers=method.findFirstToken(TokenTypes.MODIFIERS);
  if (modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
    return;
  }
  final int maxlen=NonStaticMethodCheck.ONLY_THROW_LEN;
  final boolean onlythrow=method.branchContains(TokenTypes.LITERAL_THROW) && this.getMethodLength(method) == maxlen;
  if (!AnnotationUtility.containsAnnotation(method,"String_Node_Str") && !isInAbstractOrNativeMethod(method) && !method.branchContains(TokenTypes.LITERAL_THIS)&& !onlythrow) {
    final int line=method.getLineNo();
    this.log(line,"String_Node_Str");
  }
}
Program: 107712
Project: 107712
Buggy source:
@Test public void passesValidationForClasspathSchema() throws Exception {
  final Environment env=new Environment.Mock().withFile("String_Node_Str",new StringBuilder().append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").toString());
  final Validator validator=new XmlValidator();
  validator.validate(env);
}

Fixed version (ground truth):
/** 
 * XmlValidatorTest can pass validation if schema file is in classpath.
 * @throws Exception If something goes wrong
 */
@Test public void passesValidationForClasspathSchema() throws Exception {
  final Environment env=new Environment.Mock().withFile("String_Node_Str",new StringBuilder().append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").toString());
  final Validator validator=new XmlValidator();
  validator.validate(env);
}
Program: 107713
Project: 107713
Buggy source:
/** 
 * Check that non static class method refer \"this\".
 * @param method DetailAST of method
 */
private void checkClassMethod(final DetailAST method){
  final DetailAST modifiers=method.findFirstToken(TokenTypes.MODIFIERS);
  if (modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
    return;
  }
  if (!method.branchContains(TokenTypes.LITERAL_THIS)) {
    final int line=method.getLineNo();
    this.log(line,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Check that non static class method refer \"this\". Methods annotated with   {@code @Override} are excluded.
 * @param method DetailAST of method
 */
private void checkClassMethod(final DetailAST method){
  final DetailAST modifiers=method.findFirstToken(TokenTypes.MODIFIERS);
  if (modifiers.findFirstToken(TokenTypes.LITERAL_STATIC) != null) {
    return;
  }
  if (!AnnotationUtility.containsAnnotation(method,"String_Node_Str") && !method.branchContains(TokenTypes.LITERAL_THIS)) {
    final int line=method.getLineNo();
    this.log(line,"String_Node_Str");
  }
}
Program: 107714
Project: 107714
Buggy source:
public String name(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Deprecated public String name(){
  return "String_Node_Str";
}
Program: 107715
Project: 107715
Buggy source:
public void apply(final Project project){
}

Fixed version (ground truth):
/** 
 * This method is called, when a Gradle plugin is applied to a project. In this method all the checks (Checkstyle, Findbugs etc.) should be performed.
 * @param project Gradle project, which Qulice should check.
 * @todo #339:30min Design validator classes for Gradle.
 */
public void apply(final Project project){
}
Program: 107716
Project: 107716
Buggy source:
public void apply(Project project){
  this.runMavenDependencyAnalysis(prj);
  this.runMavenEnforcerPlugin(prj);
  this.runJsLintMavenPlugin(prj);
  this.runmavenDuplicateFinderPlugin(prj);
  this.runCheckstyle(prj);
  this.runPMD(prj);
  this.runFindBugs(prj);
  this.runCobertura(prj);
  this.runCodeNarc(prj);
}

Fixed version (ground truth):
public void apply(Project project){
  this.runMavenDependencyAnalysis(project);
  this.runMavenEnforcerPlugin(project);
  this.runJsLintMavenPlugin(project);
  this.runmavenDuplicateFinderPlugin(project);
  this.runCheckstyle(project);
  this.runPMD(project);
  this.runFindBugs(project);
  this.runCobertura(project);
  this.runCodeNarc(project);
}
Program: 107717
Project: 107717
Buggy source:
@Override public ClassLoader classloader(){
  final List<URL> urls=new LinkedList<URL>();
  for (  final String path : this.classpath()) {
    try {
      urls.add(URI.create(String.format("String_Node_Str",path)).toURL());
    }
 catch (    final MalformedURLException ex) {
      throw new IllegalStateException("String_Node_Str",ex);
    }
  }
  final URLClassLoader loader=new URLClassLoader(urls.toArray(new URL[urls.size()]),Thread.currentThread().getContextClassLoader());
  for (  final URL url : loader.getURLs()) {
    Logger.debug(this,"String_Node_Str",url);
  }
  return loader;
}

Fixed version (ground truth):
@Override public ClassLoader classloader(){
  final List<URL> urls=new LinkedList<URL>();
  for (  final String path : this.classpath()) {
    try {
      urls.add(URI.create(String.format("String_Node_Str",URLEncoder.encode(path,"String_Node_Str"))).toURL());
    }
 catch (    final MalformedURLException ex) {
      throw new IllegalStateException("String_Node_Str",ex);
    }
catch (    final UnsupportedEncodingException ex) {
      throw new IllegalStateException("String_Node_Str",ex);
    }
  }
  final URLClassLoader loader=new URLClassLoader(urls.toArray(new URL[urls.size()]),Thread.currentThread().getContextClassLoader());
  for (  final URL url : loader.getURLs()) {
    Logger.debug(this,"String_Node_Str",url);
  }
  return loader;
}