nus-yam/ex-repair huggingface dataset:
Program: 94327
Project: 94327
Buggy source:
public void openLanguageDialog(){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle("String_Node_Str");
  builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  builder.setSingleChoiceItems(languages,selectedLanguageIndex,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      selectedLanguageIndex=which;
    }
  }
);
  builder.show();
}

Fixed version (ground truth):
public void openLanguageDialog(){
  int keyboardLayoutIndex=sharedpreferences.getInt("String_Node_Str",0);
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle("String_Node_Str");
  builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  builder.setSingleChoiceItems(languages,keyboardLayoutIndex,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      Editor editor=sharedpreferences.edit();
      editor.putInt("String_Node_Str",which);
      editor.commit();
    }
  }
);
  builder.show();
}
Program: 94328
Project: 94328
Buggy source:
private void start(){
  String lang;
switch (selectedLanguageIndex) {
case 1:
    lang="String_Node_Str";
  break;
case 2:
lang="String_Node_Str";
break;
case 3:
lang="String_Node_Str";
break;
case 4:
lang="String_Node_Str";
break;
case 5:
lang="String_Node_Str";
break;
case 6:
lang="String_Node_Str";
break;
case 7:
lang="String_Node_Str";
break;
case 8:
lang="String_Node_Str";
break;
case 9:
lang="String_Node_Str";
break;
case 10:
lang="String_Node_Str";
break;
case 11:
lang="String_Node_Str";
break;
default :
lang="String_Node_Str";
break;
}
String[] command=new String[1];
int pageNum=mViewPager.getCurrentItem();
if (pageNum == 0) {
switch (selectedPlatformIndex) {
case 0:
command[0]="String_Node_Str" + lang;
break;
case 1:
command[0]="String_Node_Str" + lang;
break;
default :
command[0]="String_Node_Str" + lang;
break;
}
}
 else if (pageNum == 1) {
switch (selectedPlatformIndex) {
case 0:
command[0]="String_Node_Str" + lang;
break;
case 1:
command[0]="String_Node_Str" + lang;
break;
default :
command[0]="String_Node_Str" + lang;
break;
}
}
ShellExecuter exe=new ShellExecuter();
exe.RunAsRoot(command);
((AppNavHomeActivity)getActivity()).showMessage("String_Node_Str");
}

Fixed version (ground truth):
private void start(){
  int keyboardLayoutIndex=sharedpreferences.getInt("String_Node_Str",0);
  String lang;
switch (keyboardLayoutIndex) {
case 1:
    lang="String_Node_Str";
  break;
case 2:
lang="String_Node_Str";
break;
case 3:
lang="String_Node_Str";
break;
case 4:
lang="String_Node_Str";
break;
case 5:
lang="String_Node_Str";
break;
case 6:
lang="String_Node_Str";
break;
case 7:
lang="String_Node_Str";
break;
case 8:
lang="String_Node_Str";
break;
case 9:
lang="String_Node_Str";
break;
case 10:
lang="String_Node_Str";
break;
case 11:
lang="String_Node_Str";
break;
default :
lang="String_Node_Str";
break;
}
int UACBypassIndex=sharedpreferences.getInt("String_Node_Str",0);
String[] command=new String[1];
int pageNum=mViewPager.getCurrentItem();
if (pageNum == 0) {
switch (UACBypassIndex) {
case 0:
command[0]="String_Node_Str" + lang;
break;
case 1:
command[0]="String_Node_Str" + lang;
break;
default :
command[0]="String_Node_Str" + lang;
break;
}
}
 else if (pageNum == 1) {
switch (UACBypassIndex) {
case 0:
command[0]="String_Node_Str" + lang;
break;
case 1:
command[0]="String_Node_Str" + lang;
break;
default :
command[0]="String_Node_Str" + lang;
break;
}
}
ShellExecuter exe=new ShellExecuter();
exe.RunAsRoot(command);
((AppNavHomeActivity)getActivity()).showMessage("String_Node_Str");
}
Program: 94329
Project: 94329
Buggy source:
public void openDialog(){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle("String_Node_Str");
  builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  builder.setSingleChoiceItems(platforms,selectedPlatformIndex,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      selectedPlatformIndex=which;
    }
  }
);
  builder.show();
}

Fixed version (ground truth):
public void openDialog(){
  int UACBypassIndex=sharedpreferences.getInt("String_Node_Str",0);
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle("String_Node_Str");
  builder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
);
  builder.setSingleChoiceItems(platforms,UACBypassIndex,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      Editor editor=sharedpreferences.edit();
      editor.putInt("String_Node_Str",which);
      editor.commit();
    }
  }
);
  builder.show();
}
Program: 94330
Project: 94330
Buggy source:
private static boolean isAllowed(List<Object> source,List<Object> destination){
  boolean isSame=source.equals(destination);
  int i=0;
  int j=0;
  while (i < source.size() && j < destination.size()) {
    Object srcValue=source.get(i);
    Object dstValue=destination.get(j);
    if (isInteger(srcValue.toString()) && isInteger(dstValue.toString())) {
      Integer srcInt=Integer.parseInt(srcValue.toString());
      Integer dstInt=Integer.parseInt(dstValue.toString());
      if (srcInt > dstInt) {
        return false;
      }
    }
    i++;
    j++;
  }
  return !isSame;
}

Fixed version (ground truth):
private static boolean isAllowed(List<Object> source,List<Object> destination){
  boolean isSame=source.equals(destination);
  int i=0;
  int j=0;
  while (i < source.size() && j < destination.size()) {
    Object srcValue=source.get(i);
    Object dstValue=destination.get(j);
    String srcStr=srcValue.toString();
    String dstStr=dstValue.toString();
    if (isNumber(srcStr) && isNumber(dstStr)) {
      if (srcStr.compareTo(dstStr) > 0) {
        return false;
      }
    }
    i++;
    j++;
  }
  return !isSame;
}
Program: 94331
Project: 94331
Buggy source:
private void testError() throws JsonProcessingException, ClassNotFoundException {
  JsonNode node=p.getNode();
  JsonNode first=node.get("String_Node_Str");
  JsonNode patch=node.get("String_Node_Str");
  JsonNode message=node.get("String_Node_Str");
  Class<?> type=node.has("String_Node_Str") ? exceptionType(node.get("String_Node_Str").textValue()) : JsonPatchApplicationException.class;
  try {
    JsonPatch.apply(patch,first);
    fail(errorMessage("String_Node_Str" + message));
  }
 catch (  Exception e) {
    assertThat(errorMessage("String_Node_Str"),e,instanceOf(type));
    if (message != null) {
      assertThat(errorMessage("String_Node_Str"),e.getMessage(),containsString(message.textValue()));
    }
  }
}

Fixed version (ground truth):
private void testError() throws JsonProcessingException, ClassNotFoundException {
  JsonNode node=p.getNode();
  JsonNode first=node.get("String_Node_Str");
  JsonNode patch=node.get("String_Node_Str");
  JsonNode message=node.get("String_Node_Str");
  Class<?> type=node.has("String_Node_Str") ? exceptionType(node.get("String_Node_Str").textValue()) : JsonPatchApplicationException.class;
  try {
    JsonPatch.apply(patch,first);
    fail(errorMessage("String_Node_Str" + message));
  }
 catch (  Exception e) {
    if (matchOnErrors()) {
      assertThat(errorMessage("String_Node_Str"),e,instanceOf(type));
      if (message != null) {
        assertThat(errorMessage("String_Node_Str"),e.getMessage(),containsString(message.textValue()));
      }
    }
  }
}
Program: 94332
Project: 94332
Buggy source:
private static void introduceCopyOperation(JsonNode source,JsonNode target,List<Diff> diffs){
  Map<JsonNode,List<Object>> unchangedValues=getUnchangedPart(source,target);
  for (int i=0; i < diffs.size(); i++) {
    Diff diff=diffs.get(i);
    if (Operation.ADD.equals(diff.getOperation())) {
      List<Object> matchingValuePath=getMatchingValuePath(unchangedValues,diff.getValue());
      if (matchingValuePath != null) {
        diffs.set(i,new Diff(Operation.COPY,matchingValuePath,diff.getPath()));
      }
    }
  }
}

Fixed version (ground truth):
private static void introduceCopyOperation(JsonNode source,JsonNode target,List<Diff> diffs){
  Map<JsonNode,List<Object>> unchangedValues=getUnchangedPart(source,target);
  for (int i=0; i < diffs.size(); i++) {
    Diff diff=diffs.get(i);
    if (Operation.ADD.equals(diff.getOperation())) {
      List<Object> matchingValuePath=getMatchingValuePath(unchangedValues,diff.getValue());
      if (matchingValuePath != null && !isSame(matchingValuePath,diff.getPath())) {
        diffs.set(i,new Diff(Operation.COPY,matchingValuePath,diff.getPath()));
      }
    }
  }
}
Program: 94333
Project: 94333
Buggy source:
@Test public void applyInPlaceMutatesSource() throws Exception {
  JsonNode patch=readTree("String_Node_Str");
  ObjectNode source=newObjectNode();
  JsonPatch.applyInPlace(patch,source);
  assertThat(source.findValue("String_Node_Str").asText(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void applyInPlaceMutatesSource() throws Exception {
  JsonNode patch=readTree("String_Node_Str");
  ObjectNode source=newObjectNode();
  ObjectNode beforeApplication=source.deepCopy();
  JsonPatch.apply(patch,source);
  assertThat(source,is(beforeApplication));
}
Program: 94334
Project: 94334
Buggy source:
private void setTypeFace(Context context,AttributeSet attrs){
  TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.Typefaceable,0,0);
  try {
    isHtml=a.getBoolean(R.styleable.Typefaceable_html,false);
    letterSpace=a.getFloat(R.styleable.Typefaceable_letterSpace,NO_LETTER_SPACE);
    textTransform=TRANSFORM.findByValue(a.getInt(R.styleable.Typefaceable_textTransform,TRANSFORM.NONE.value));
    String typefaceName=a.getString(R.styleable.Typefaceable_font);
    if (typefaceName != null && !TextUtils.isEmpty(typefaceName)) {
      Typeface typeface=TypefaceLoader.get(context,typefaceName);
      if (!view.isInEditMode()) {
        view.setTypeface(typeface);
      }
      view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
  }
  finally {
    a.recycle();
  }
  createLetterSpacing(view.getText());
}

Fixed version (ground truth):
private void setTypeFace(Context context,AttributeSet attrs){
  TypedArray a=context.getTheme().obtainStyledAttributes(attrs,R.styleable.Typefaceable,0,0);
  try {
    isHtml=a.getBoolean(R.styleable.Typefaceable_html,false);
    letterSpace=a.getFloat(R.styleable.Typefaceable_letterSpace,NO_LETTER_SPACE);
    textTransform=TRANSFORM.findByValue(a.getInt(R.styleable.Typefaceable_textTransform,TRANSFORM.NONE.value));
    String typefaceName=a.getString(R.styleable.Typefaceable_font);
    if (typefaceName != null && !TextUtils.isEmpty(typefaceName)) {
      Typeface typeface=TypefaceLoader.get(context,typefaceName);
      view.setTypeface(typeface);
      view.setPaintFlags(view.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG);
    }
  }
  finally {
    a.recycle();
  }
  createLetterSpacing(view.getText());
}
Program: 94335
Project: 94335
Buggy source:
public void attemptConnection(){
  mBluetoothManager=(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
  if (device != null) {
    for (    BluetoothDevice bluetoothDevice : mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT)) {
      if (bluetoothDevice.getAddress().compareTo(device.getAddress()) == 0) {
        mConnectionState=STATE_CONNECTED;
      }
    }
  }
  Log.w(TAG,"String_Node_Str" + mConnectionState);
  if (mConnectionState == STATE_DISCONNECTED || mConnectionState == STATE_DISCONNECTING) {
    ActiveBluetoothDevice btDevice=ActiveBluetoothDevice.first();
    if (btDevice != null) {
      mDeviceName=btDevice.name;
      mDeviceAddress=btDevice.address;
      mBluetoothAdapter=mBluetoothManager.getAdapter();
      if (mBluetoothAdapter.isEnabled() && mBluetoothAdapter.getRemoteDevice(mDeviceAddress) != null) {
        connect(mDeviceAddress);
        return;
      }
 else {
        Log.w(TAG,"String_Node_Str");
        setRetryTimer();
        return;
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      setRetryTimer();
      return;
    }
  }
 else   if (mConnectionState == STATE_CONNECTED && mBluetoothGatt != null) {
    attemptRead();
    return;
  }
 else {
    setRetryTimer();
    return;
  }
}

Fixed version (ground truth):
public void attemptConnection(){
  mBluetoothManager=(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
  if (device != null) {
    mConnectionState=STATE_DISCONNECTED;
    for (    BluetoothDevice bluetoothDevice : mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT)) {
      if (bluetoothDevice.getAddress().compareTo(device.getAddress()) == 0) {
        mConnectionState=STATE_CONNECTED;
      }
    }
  }
  Log.w(TAG,"String_Node_Str" + mConnectionState);
  if (mConnectionState == STATE_DISCONNECTED || mConnectionState == STATE_DISCONNECTING) {
    ActiveBluetoothDevice btDevice=ActiveBluetoothDevice.first();
    if (btDevice != null) {
      mDeviceName=btDevice.name;
      mDeviceAddress=btDevice.address;
      mBluetoothAdapter=mBluetoothManager.getAdapter();
      if (mBluetoothAdapter.isEnabled() && mBluetoothAdapter.getRemoteDevice(mDeviceAddress) != null) {
        connect(mDeviceAddress);
        return;
      }
 else {
        Log.w(TAG,"String_Node_Str");
        setRetryTimer();
        return;
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      setRetryTimer();
      return;
    }
  }
 else   if (mConnectionState == STATE_CONNECTED) {
    Log.w(TAG,"String_Node_Str");
    attemptRead();
    return;
  }
 else {
    setRetryTimer();
    return;
  }
}
Program: 94336
Project: 94336
Buggy source:
@Override public void onCreate(){
  super.onCreate();
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  readData=new ReadDataShare(this);
  final IntentFilter bondintent=new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
  registerReceiver(mPairReceiver,bondintent);
  prefs=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  listenForChangeInSettings();
}
Program: 94337
Project: 94337
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  if (CollectionServiceStarter.isBTShare(getApplicationContext())) {
    setFailoverTimer();
  }
  if (Sensor.currentSensor() == null) {
    setRetryTimer();
    return START_NOT_STICKY;
  }
  final IntentFilter bondintent=new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
  registerReceiver(mPairReceiver,bondintent);
  prefs=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  listenForChangeInSettings();
  Log.w(TAG,"String_Node_Str");
  attemptConnection();
  return START_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  if (CollectionServiceStarter.isBTShare(getApplicationContext())) {
    setFailoverTimer();
  }
  if (Sensor.currentSensor() == null) {
    setRetryTimer();
    return START_NOT_STICKY;
  }
  Log.w(TAG,"String_Node_Str");
  attemptConnection();
  return START_STICKY;
}
Program: 94339
Project: 94339
Buggy source:
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  Log.w(TAG,"String_Node_Str" + status + "String_Node_Str"+ newState);
  if (status == 133) {
    Log.e(TAG,"String_Node_Str");
    gatt.close();
    return;
  }
  if (newState == BluetoothProfile.STATE_CONNECTED) {
    mBluetoothGatt=gatt;
    device=mBluetoothGatt.getDevice();
    mConnectionState=STATE_CONNECTED;
    ActiveBluetoothDevice.connected();
    Log.w(TAG,"String_Node_Str");
    if (device.getBondState() == BluetoothDevice.BOND_BONDED) {
      Log.w(TAG,"String_Node_Str");
      currentGattTask=GATT_SETUP;
      if (!mBluetoothGatt.discoverServices()) {
        Log.w(TAG,"String_Node_Str");
        setRetryTimer();
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      bondDevice();
    }
  }
 else   if (newState == BluetoothProfile.STATE_DISCONNECTED) {
    mConnectionState=STATE_DISCONNECTED;
    ActiveBluetoothDevice.disconnected();
    setRetryTimer();
    Log.w(TAG,"String_Node_Str");
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  Log.w(TAG,"String_Node_Str" + status + "String_Node_Str"+ newState);
  if (status == 133) {
    Log.e(TAG,"String_Node_Str");
  }
  if (newState == BluetoothProfile.STATE_CONNECTED) {
    mBluetoothGatt=gatt;
    device=mBluetoothGatt.getDevice();
    mConnectionState=STATE_CONNECTED;
    ActiveBluetoothDevice.connected();
    Log.w(TAG,"String_Node_Str");
    if (device.getBondState() == BluetoothDevice.BOND_BONDED) {
      Log.w(TAG,"String_Node_Str");
      currentGattTask=GATT_SETUP;
      if (!mBluetoothGatt.discoverServices()) {
        Log.w(TAG,"String_Node_Str");
        setRetryTimer();
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      bondDevice();
    }
  }
 else   if (newState == BluetoothProfile.STATE_DISCONNECTED) {
    mConnectionState=STATE_DISCONNECTED;
    ActiveBluetoothDevice.disconnected();
    setRetryTimer();
    Log.w(TAG,"String_Node_Str");
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}
Program: 94340
Project: 94340
Buggy source:
@Override public void onDestroy(){
  AlarmManager alarm=(AlarmManager)getSystemService(ALARM_SERVICE);
  alarm.set(alarm.RTC_WAKEUP,System.currentTimeMillis() + (1000 * 60),PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0));
  close();
  foregroundServiceStarter.stop();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  setRetryTimer();
  close();
  foregroundServiceStarter.stop();
}
Program: 94341
Project: 94341
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  PendingIntent pending=PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0);
  AlarmManager alarmManager=(AlarmManager)this.getSystemService(Context.ALARM_SERVICE);
  alarmManager.cancel(pending);
  attemptConnection();
  this.startService(new Intent(this,SyncService.class));
  return START_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  attemptConnection();
  this.startService(new Intent(this,SyncService.class));
  return START_STICKY;
}
Program: 94342
Project: 94342
Buggy source:
public void setRetryTimer(){
  AlarmManager alarm=(AlarmManager)getSystemService(ALARM_SERVICE);
  alarm.set(alarm.RTC_WAKEUP,System.currentTimeMillis() + (1000 * 60 * 1),PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0));
}

Fixed version (ground truth):
public void setRetryTimer(){
  Calendar calendar=Calendar.getInstance();
  AlarmManager alarm=(AlarmManager)getSystemService(ALARM_SERVICE);
  alarm.set(alarm.RTC_WAKEUP,calendar.getTimeInMillis() + (1000 * 60),PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0));
}
Program: 94343
Project: 94343
Buggy source:
public void listenForChangeInSettings(){
  SharedPreferences.OnSharedPreferenceChangeListener listener=new SharedPreferences.OnSharedPreferenceChangeListener(){
    public void onSharedPreferenceChanged(    SharedPreferences prefs,    String key){
      if (key.compareTo("String_Node_Str") == 0) {
        if (prefs.getBoolean("String_Node_Str",false)) {
          foregroundServiceStarter=new ForegroundServiceStarter(getApplicationContext(),dexCollectionService);
          foregroundServiceStarter.start();
        }
 else {
          dexCollectionService.stopForeground(true);
        }
      }
      if (key.compareTo("String_Node_Str") == 0) {
        CollectionServiceStarter collectionServiceStarter=new CollectionServiceStarter();
        collectionServiceStarter.start(getApplicationContext());
      }
    }
  }
;
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(mContext);
  prefs.registerOnSharedPreferenceChangeListener(listener);
}

Fixed version (ground truth):
public void listenForChangeInSettings(){
  SharedPreferences.OnSharedPreferenceChangeListener listener=new SharedPreferences.OnSharedPreferenceChangeListener(){
    public void onSharedPreferenceChanged(    SharedPreferences prefs,    String key){
      if (key.compareTo("String_Node_Str") == 0) {
        if (prefs.getBoolean("String_Node_Str",false)) {
          foregroundServiceStarter=new ForegroundServiceStarter(getApplicationContext(),dexCollectionService);
          foregroundServiceStarter.start();
        }
 else {
          dexCollectionService.stopForeground(true);
        }
      }
      if (key.compareTo("String_Node_Str") == 0) {
        CollectionServiceStarter collectionServiceStarter=new CollectionServiceStarter();
        collectionServiceStarter.start(getApplicationContext());
      }
    }
  }
;
  prefs=PreferenceManager.getDefaultSharedPreferences(mContext);
  prefs.registerOnSharedPreferenceChangeListener(listener);
}
Program: 94344
Project: 94344
Buggy source:
public void attemptConnection(){
  ActiveBluetoothDevice btDevice=new Select().from(ActiveBluetoothDevice.class).orderBy("String_Node_Str").executeSingle();
  if (btDevice != null) {
    mDeviceName=btDevice.name;
    mDeviceAddress=btDevice.address;
    if (mBluetoothManager == null) {
      mBluetoothManager=(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
      if (mBluetoothManager == null) {
        Log.w(TAG,"String_Node_Str");
      }
    }
    if (mBluetoothManager != null) {
      mBluetoothAdapter=mBluetoothManager.getAdapter();
      if (mBluetoothAdapter == null) {
        Log.w(TAG,"String_Node_Str");
      }
      is_connected=connect(mDeviceAddress);
      if (is_connected) {
        Log.i(TAG,"String_Node_Str");
      }
 else {
        Log.i(TAG,"String_Node_Str");
        setRetryTimer();
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      setRetryTimer();
    }
  }
 else {
    Log.w(TAG,"String_Node_Str");
    setRetryTimer();
  }
}

Fixed version (ground truth):
public void attemptConnection(){
  if (mConnectionState == STATE_DISCONNECTED) {
    ActiveBluetoothDevice btDevice=new Select().from(ActiveBluetoothDevice.class).orderBy("String_Node_Str").executeSingle();
    if (btDevice != null) {
      mDeviceName=btDevice.name;
      mDeviceAddress=btDevice.address;
      if (mBluetoothManager == null) {
        mBluetoothManager=(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
        if (mBluetoothManager == null) {
          Log.w(TAG,"String_Node_Str");
        }
      }
      if (mBluetoothManager != null) {
        mBluetoothAdapter=mBluetoothManager.getAdapter();
        if (mBluetoothAdapter == null) {
          Log.w(TAG,"String_Node_Str");
        }
        is_connected=connect(mDeviceAddress);
        if (is_connected) {
          Log.i(TAG,"String_Node_Str");
        }
 else {
          Log.i(TAG,"String_Node_Str");
          setRetryTimer();
        }
      }
 else {
        Log.w(TAG,"String_Node_Str");
        setRetryTimer();
      }
    }
 else {
      Log.w(TAG,"String_Node_Str");
      setRetryTimer();
    }
  }
}
Program: 94345
Project: 94345
Buggy source:
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  if (newState == BluetoothProfile.STATE_CONNECTED) {
    mConnectionState=STATE_CONNECTED;
    Log.i(TAG,"String_Node_Str");
    Log.w(TAG,"String_Node_Str" + mBluetoothGatt.discoverServices());
  }
 else   if (newState == BluetoothProfile.STATE_DISCONNECTED) {
    mConnectionState=STATE_DISCONNECTED;
    Log.i(TAG,"String_Node_Str");
    is_connected=connect(mDeviceAddress);
    if (is_connected) {
      Log.i(TAG,"String_Node_Str");
    }
 else {
      Log.i(TAG,"String_Node_Str");
      setRetryTimer();
    }
  }
}

Fixed version (ground truth):
@Override public void onConnectionStateChange(BluetoothGatt gatt,int status,int newState){
  if (newState == BluetoothProfile.STATE_CONNECTED) {
    mConnectionState=STATE_CONNECTED;
    Log.i(TAG,"String_Node_Str");
    Log.w(TAG,"String_Node_Str" + mBluetoothGatt.discoverServices());
  }
 else   if (newState == BluetoothProfile.STATE_DISCONNECTED) {
    mConnectionState=STATE_DISCONNECTED;
    Log.i(TAG,"String_Node_Str");
    setRetryTimer();
  }
}
Program: 94346
Project: 94346
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  attemptSend();
  PendingIntent pending=PendingIntent.getService(this,0,new Intent(this,SyncService.class),0);
  AlarmManager alarmManager=(AlarmManager)this.getSystemService(Context.ALARM_SERVICE);
  alarmManager.cancel(pending);
  startSleep();
  return mStartMode;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  attemptSend();
  setRetryTimer();
  return START_STICKY;
}
Program: 94347
Project: 94347
Buggy source:
public static List<BgSendQueue> mongoQueue(){
  return new Select().from(BgSendQueue.class).where("String_Node_Str",false).where("String_Node_Str","String_Node_Str").orderBy("String_Node_Str").limit(20).execute();
}

Fixed version (ground truth):
public static List<BgSendQueue> mongoQueue(){
  return new Select().from(BgSendQueue.class).where("String_Node_Str",false).where("String_Node_Str","String_Node_Str").orderBy("String_Node_Str").limit(10).execute();
}
Program: 94348
Project: 94348
Buggy source:
public static List<CalibrationSendQueue> mongoQueue(){
  return new Select().from(CalibrationSendQueue.class).where("String_Node_Str",false).orderBy("String_Node_Str").execute();
}

Fixed version (ground truth):
public static List<CalibrationSendQueue> mongoQueue(){
  return new Select().from(CalibrationSendQueue.class).where("String_Node_Str",false).orderBy("String_Node_Str").limit(10).execute();
}
Program: 94349
Project: 94349
Buggy source:
private boolean doRESTUpload(SharedPreferences prefs,List<BgReading> glucoseDataSets,List<Calibration> meterRecords,List<Calibration> calRecords){
  String baseURLSettings=prefs.getString("String_Node_Str","String_Node_Str");
  ArrayList<String> baseURIs=new ArrayList<String>();
  try {
    for (    String baseURLSetting : baseURLSettings.split("String_Node_Str")) {
      String baseURL=baseURLSetting.trim();
      if (baseURL.isEmpty())       continue;
      baseURIs.add(baseURL + (baseURL.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str"));
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str" + baseURLSettings,e);
    return false;
  }
  for (  String baseURI : baseURIs) {
    try {
      doRESTUploadTo(baseURI,glucoseDataSets,meterRecords,calRecords);
    }
 catch (    Exception e) {
      Log.e(TAG,"String_Node_Str" + baseURI,e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean doRESTUpload(SharedPreferences prefs,List<BgReading> glucoseDataSets,List<Calibration> meterRecords,List<Calibration> calRecords){
  String baseURLSettings=prefs.getString("String_Node_Str","String_Node_Str");
  ArrayList<String> baseURIs=new ArrayList<String>();
  try {
    for (    String baseURLSetting : baseURLSettings.split("String_Node_Str")) {
      String baseURL=baseURLSetting.trim();
      if (baseURL.isEmpty())       continue;
      baseURIs.add(baseURL + (baseURL.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str"));
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str");
    return false;
  }
  for (  String baseURI : baseURIs) {
    try {
      doRESTUploadTo(baseURI,glucoseDataSets,meterRecords,calRecords);
    }
 catch (    Exception e) {
      Log.e(TAG,"String_Node_Str");
      return false;
    }
  }
  return true;
}
Program: 94352
Project: 94352
Buggy source:
private void broadcastUpdate(final String action,final BluetoothGattCharacteristic characteristic){
  Log.w(TAG,"String_Node_Str");
  final byte[] data=characteristic.getValue();
  Log.i(TAG,"String_Node_Str" + characteristic.getValue());
  if (data != null && data.length > 0) {
    setSerialDataToTransmitterRawData(data,data.length);
    Log.w(TAG,"String_Node_Str");
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void broadcastUpdate(final String action,final BluetoothGattCharacteristic characteristic){
  final byte[] data=characteristic.getValue();
  Log.i(TAG,"String_Node_Str" + characteristic.getValue());
  if (data != null && data.length > 0) {
    setSerialDataToTransmitterRawData(data,data.length);
    Log.d(TAG,"String_Node_Str");
  }
}
Program: 94353
Project: 94353
Buggy source:
public void setRetryTimer(){
  AlarmManager alarm=(AlarmManager)getSystemService(ALARM_SERVICE);
  alarm.set(alarm.ELAPSED_REALTIME_WAKEUP,System.currentTimeMillis() + (1000 * 60 * 3),PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0));
  stopSelf();
}

Fixed version (ground truth):
public void setRetryTimer(){
  AlarmManager alarm=(AlarmManager)getSystemService(ALARM_SERVICE);
  alarm.set(alarm.ELAPSED_REALTIME_WAKEUP,System.currentTimeMillis() + (1000 * 60 * 3),PendingIntent.getService(this,0,new Intent(this,DexCollectionService.class),0));
  close();
  stopSelf();
}
Program: 94354
Project: 94354
Buggy source:
@Override public void onCharacteristicRead(BluetoothGatt gatt,BluetoothGattCharacteristic characteristic,int status){
  if (status == BluetoothGatt.GATT_SUCCESS) {
    Log.w(TAG,"String_Node_Str");
    broadcastUpdate(ACTION_DATA_AVAILABLE,characteristic);
  }
 else {
    Log.w(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onCharacteristicRead(BluetoothGatt gatt,BluetoothGattCharacteristic characteristic,int status){
  if (status == BluetoothGatt.GATT_SUCCESS) {
    broadcastUpdate(ACTION_DATA_AVAILABLE,characteristic);
  }
}
Program: 94355
Project: 94355
Buggy source:
public void close(){
  if (mBluetoothGatt == null) {
    return;
  }
  mBluetoothGatt.close();
  mBluetoothGatt=null;
}

Fixed version (ground truth):
public void close(){
  disconnect();
  if (mBluetoothGatt == null) {
    return;
  }
  mBluetoothGatt.close();
  mBluetoothGatt=null;
  mConnectionState=STATE_DISCONNECTED;
}
Program: 94356
Project: 94356
Buggy source:
public static void clearAllCalibrationNotifications(){
  notificationDismiss(BgNotificationId);
}

Fixed version (ground truth):
public static void clearAllCalibrationNotifications(){
  notificationDismiss(calibrationNotificationId);
  notificationDismiss(extraCalibrationNotificationId);
  notificationDismiss(doubleCalibrationNotificationId);
}
Program: 94359
Project: 94359
Buggy source:
@SuppressWarnings("String_Node_Str") static com.vividsolutions.jts.geom.Geometry intersect(com.vividsolutions.jts.geom.Polygon jtsClip,com.vividsolutions.jts.geom.Geometry jtsGeom){
  com.vividsolutions.jts.geom.Geometry jtsClipped;
  try {
    jtsClipped=jtsGeom.intersection(jtsClip);
  }
 catch (  TopologyException e) {
    com.vividsolutions.jts.geom.Geometry g=TopologyPreservingSimplifier.simplify(jtsGeom,1E-8);
    try {
      jtsClipped=g.intersection(jtsClip);
    }
 catch (    TopologyException e1) {
      log.error("String_Node_Str" + jtsClip + "String_Node_Str"+ jtsGeom+ "String_Node_Str"+ e1.getMessage());
      log.error("String_Node_Str",e1);
      return new com.vividsolutions.jts.geom.GeometryFactory().createPoint((Coordinate)null);
    }
  }
  return jtsClipped;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static com.vividsolutions.jts.geom.Geometry intersect(com.vividsolutions.jts.geom.Polygon jtsClip,com.vividsolutions.jts.geom.Geometry jtsGeom){
  com.vividsolutions.jts.geom.Geometry jtsClipped;
  try {
    jtsClipped=jtsGeom.intersection(jtsClip);
  }
 catch (  TopologyException e) {
    try {
      jtsClipped=jtsGeom.buffer(0).intersection(jtsClip);
    }
 catch (    TopologyException e1) {
      com.vividsolutions.jts.geom.Geometry g=TopologyPreservingSimplifier.simplify(jtsGeom,1E-6);
      try {
        jtsClipped=g.intersection(jtsClip);
      }
 catch (      TopologyException e2) {
        try {
          jtsClipped=g.buffer(0).intersection(jtsClip);
        }
 catch (        TopologyException e3) {
          log.error("String_Node_Str" + jtsClip + "String_Node_Str"+ jtsGeom+ "String_Node_Str"+ e1.getMessage());
          return new com.vividsolutions.jts.geom.GeometryFactory().createPoint((Coordinate)null);
        }
      }
    }
  }
  return jtsClipped;
}
Program: 94362
Project: 94362
Buggy source:
static private String parsePoints(String geometryStr,String geometryType){
  StringBuilder geometry=new StringBuilder(geometryStr);
  String regex="String_Node_Str";
  String[] pointsArray=geometryStr.split(regex);
  if (geometryStr.contains("String_Node_Str") || geometryStr.contains("String_Node_Str")) {
    geometry=new StringBuilder();
    for (    String pa : pointsArray) {
      if (geometry.length() > 0) {
        geometry.append("String_Node_Str");
      }
      geometry.append(pa);
    }
  }
  if (geometryType.toLowerCase().contains("String_Node_Str")) {
    if (!pointsArray[0].trim().equalsIgnoreCase(pointsArray[pointsArray.length - 1].trim())) {
      geometry.append("String_Node_Str").append(pointsArray[0]);
    }
  }
  return geometry.toString();
}

Fixed version (ground truth):
static private String parsePoints(String geometryStr,String geometryType){
  StringBuilder geometry=new StringBuilder();
  String regex="String_Node_Str";
  String[] pointsArray=geometryStr.split(regex);
  for (  String pa : pointsArray) {
    if (geometry.length() > 0) {
      geometry.append("String_Node_Str");
    }
    geometry.append(pa);
  }
  int len=pointsArray.length;
  if (geometryType.contains("String_Node_Str")) {
    if (!pointsArray[0].trim().equalsIgnoreCase(pointsArray[pointsArray.length - 1].trim())) {
      geometry.append("String_Node_Str").append(pointsArray[0]);
      len++;
    }
    for (int i=len; i < 4; i++) {
      geometry.append("String_Node_Str").append(pointsArray[0]);
    }
  }
  return geometry.toString();
}
Program: 94363
Project: 94363
Buggy source:
@SuppressWarnings("String_Node_Str") static com.vividsolutions.jts.geom.Geometry intersect(com.vividsolutions.jts.geom.Polygon jtsClip,com.vividsolutions.jts.geom.Geometry jtsGeom){
  com.vividsolutions.jts.geom.Geometry jtsClipped;
  try {
    jtsClipped=jtsGeom.intersection(jtsClip);
  }
 catch (  TopologyException e) {
    try {
      jtsClipped=jtsGeom.buffer(0).intersection(jtsClip);
    }
 catch (    TopologyException e1) {
      com.vividsolutions.jts.geom.Geometry g=TopologyPreservingSimplifier.simplify(jtsGeom,1E-6);
      try {
        jtsClipped=g.intersection(jtsClip);
      }
 catch (      TopologyException e2) {
        try {
          jtsClipped=g.buffer(0).intersection(jtsClip);
        }
 catch (        TopologyException e3) {
          log.error("String_Node_Str" + jtsClip + "String_Node_Str"+ jtsGeom+ "String_Node_Str"+ e1.getMessage());
          return new com.vividsolutions.jts.geom.GeometryFactory().createPoint((Coordinate)null);
        }
      }
    }
  }
  return jtsClipped;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") static com.vividsolutions.jts.geom.Geometry intersect(com.vividsolutions.jts.geom.Polygon jtsClip,com.vividsolutions.jts.geom.Geometry jtsGeom){
  com.vividsolutions.jts.geom.Geometry jtsClipped;
  try {
    jtsClipped=jtsGeom.intersection(jtsClip);
  }
 catch (  TopologyException e) {
    try {
      jtsClipped=jtsGeom.buffer(0).intersection(jtsClip);
    }
 catch (    TopologyException e1) {
      com.vividsolutions.jts.geom.Geometry g=TopologyPreservingSimplifier.simplify(jtsGeom,1E-8);
      try {
        jtsClipped=g.intersection(jtsClip);
      }
 catch (      TopologyException e2) {
        try {
          jtsClipped=g.buffer(0).intersection(jtsClip);
        }
 catch (        TopologyException e3) {
          log.error("String_Node_Str" + jtsClip + "String_Node_Str"+ jtsGeom+ "String_Node_Str"+ e1.getMessage());
          return new com.vividsolutions.jts.geom.GeometryFactory().createPoint((Coordinate)null);
        }
      }
    }
  }
  return jtsClipped;
}
Program: 94367
Project: 94367
Buggy source:
public abstract int getBands(final MrGeoRaster raster);

Fixed version (ground truth):
public abstract int getBands(final int sourceBands);
Program: 94368
Project: 94368
Buggy source:
@Override public int getBands(final MrGeoRaster raster){
  return 3;
}

Fixed version (ground truth):
@Override public int getBands(final int sourceBands){
  return 3;
}
Program: 94369
Project: 94369
Buggy source:
@Override public MrGeoRaster applyColorScale(final MrGeoRaster raster,ColorScale colorScale,final double[] extrema,final double[] defaultValues,final double[][] quantiles) throws ColorScale.ColorScaleException {
  try {
    MrGeoRaster colored=MrGeoRaster.createEmptyRaster(raster.width(),raster.height(),getBands(raster),DataBuffer.TYPE_BYTE);
    colored.fill(RasterUtils.getDefaultNoDataForType(DataBuffer.TYPE_BYTE));
    setupExtrema(colorScale,extrema,defaultValues[0],(quantiles == null || quantiles.length == 0) ? null : quantiles[0]);
    apply(raster,colored,colorScale);
    return colored;
  }
 catch (  MrGeoRaster.MrGeoRasterException e) {
    throw new ColorScale.ColorScaleException(e);
  }
}

Fixed version (ground truth):
@Override public MrGeoRaster applyColorScale(final MrGeoRaster raster,ColorScale colorScale,final double[] extrema,final double[] defaultValues,final double[][] quantiles) throws ColorScale.ColorScaleException {
  try {
    MrGeoRaster colored=MrGeoRaster.createEmptyRaster(raster.width(),raster.height(),getBands(raster.bands()),DataBuffer.TYPE_BYTE);
    colored.fill(RasterUtils.getDefaultNoDataForType(DataBuffer.TYPE_BYTE));
    setupExtrema(colorScale,extrema,defaultValues[0],(quantiles == null || quantiles.length == 0) ? null : quantiles[0]);
    apply(raster,colored,colorScale);
    return colored;
  }
 catch (  MrGeoRaster.MrGeoRasterException e) {
    throw new ColorScale.ColorScaleException(e);
  }
}
Program: 94370
Project: 94370
Buggy source:
@Override public int getBands(final MrGeoRaster raster){
  return raster.bands() == 3 ? 3 : 4;
}

Fixed version (ground truth):
@Override public int getBands(final int sourceBands){
  return sourceBands == 3 ? 3 : 4;
}
Program: 94371
Project: 94371
Buggy source:
@Override public MrGeoRaster applyColorScale(final MrGeoRaster raster,ColorScale colorScale,final double[] extrema,final double[] defaultValues,final double[][] quantiles) throws ColorScale.ColorScaleException {
  try {
    MrGeoRaster colored=MrGeoRaster.createEmptyRaster(raster.width(),raster.height(),getBands(raster),DataBuffer.TYPE_BYTE);
    colored.fill(RasterUtils.getDefaultNoDataForType(DataBuffer.TYPE_BYTE));
    setupExtrema(colorScale,extrema,defaultValues[0],(quantiles == null || quantiles.length == 0) ? null : quantiles[0]);
    apply(raster,colored,colorScale);
    return colored;
  }
 catch (  MrGeoRaster.MrGeoRasterException e) {
    throw new ColorScale.ColorScaleException(e);
  }
}

Fixed version (ground truth):
@Override public MrGeoRaster applyColorScale(final MrGeoRaster raster,ColorScale colorScale,final double[] extrema,final double[] defaultValues,final double[][] quantiles) throws ColorScale.ColorScaleException {
  try {
    MrGeoRaster colored=MrGeoRaster.createEmptyRaster(raster.width(),raster.height(),getBands(raster.bands()),DataBuffer.TYPE_BYTE);
    colored.fill(RasterUtils.getDefaultNoDataForType(DataBuffer.TYPE_BYTE));
    setupExtrema(colorScale,extrema,defaultValues[0],(quantiles == null || quantiles.length == 0) ? null : quantiles[0]);
    apply(raster,colored,colorScale);
    return colored;
  }
 catch (  MrGeoRaster.MrGeoRasterException e) {
    throw new ColorScale.ColorScaleException(e);
  }
}
Program: 94373
Project: 94373
Buggy source:
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public static String findMrGeoConf() throws IOException {
  String conf=System.getenv(MrGeoConstants.MRGEO_CONF_DIR);
  if (conf == null) {
    String home=System.getenv(MrGeoConstants.MRGEO_HOME);
    File dir=new File(home,MrGeoConstants.MRGEO_HOME_CONF_DIR);
    if (dir.exists()) {
      log.error(MrGeoConstants.MRGEO_HOME + "String_Node_Str" + "String_Node_Str"+ MrGeoConstants.MRGEO_CONF_DIR+ "String_Node_Str"+ MrGeoConstants.MRGEO_COMMON_HOME+ "String_Node_Str");
      conf=dir.getCanonicalPath();
    }
  }
  File file=new File(conf,MrGeoConstants.MRGEO_CONF);
  if (file.exists()) {
    return file.getCanonicalPath();
  }
  throw new IOException(MrGeoConstants.MRGEO_CONF_DIR + "String_Node_Str" + file.getCanonicalPath());
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public static String findMrGeoConf() throws IOException {
  String conf=System.getenv(MrGeoConstants.MRGEO_CONF_DIR);
  if (conf == null) {
    String home=System.getenv(MrGeoConstants.MRGEO_HOME);
    if (home != null) {
      File dir=new File(home,MrGeoConstants.MRGEO_HOME_CONF_DIR);
      if (dir.exists()) {
        log.error(MrGeoConstants.MRGEO_HOME + "String_Node_Str" + "String_Node_Str"+ MrGeoConstants.MRGEO_CONF_DIR+ "String_Node_Str"+ MrGeoConstants.MRGEO_COMMON_HOME+ "String_Node_Str");
        conf=dir.getCanonicalPath();
      }
    }
  }
  if (conf == null) {
    conf=System.getProperty(MrGeoConstants.MRGEO_CONF_DIR);
  }
  if (conf != null) {
    File file=new File(conf,MrGeoConstants.MRGEO_CONF);
    if (file.exists()) {
      return file.getCanonicalPath();
    }
    throw new IOException(MrGeoConstants.MRGEO_CONF_DIR + "String_Node_Str" + file.getCanonicalPath());
  }
  throw new IOException(MrGeoConstants.MRGEO_CONF_DIR + "String_Node_Str");
}
Program: 94374
Project: 94374
Buggy source:
private static AdHocDataProvider createAdHocDataProvider(final Configuration conf,final ProviderProperties props) throws DataProviderNotFound, DataProviderException {
  initialize(conf);
  for (  final AdHocDataProviderFactory factory : adHocProviderFactories.values()) {
    AdHocDataProvider provider;
    try {
      provider=factory.createAdHocDataProvider(props);
    }
 catch (    IOException e) {
      throw new DataProviderException("String_Node_Str",e);
    }
    adHocProviderCache.put(provider.getResourceName(),provider);
    return provider;
  }
  throw new DataProviderNotFound("String_Node_Str");
}

Fixed version (ground truth):
private static AdHocDataProvider createAdHocDataProvider(final Configuration conf,final ProviderProperties props) throws DataProviderNotFound, DataProviderException {
  initialize(conf);
  for (  final AdHocDataProviderFactory factory : adHocProviderFactories.values()) {
    AdHocDataProvider provider;
    try {
      provider=factory.createAdHocDataProvider(conf,props);
    }
 catch (    IOException e) {
      throw new DataProviderException("String_Node_Str",e);
    }
    adHocProviderCache.put(provider.getResourceName(),provider);
    return provider;
  }
  throw new DataProviderNotFound("String_Node_Str");
}
Program: 94375
Project: 94375
Buggy source:
private static MrsImageDataProvider createTempMrsImageDataProvider(final Configuration conf,final ProviderProperties providerProperties) throws DataProviderNotFound, DataProviderException {
  initialize(conf);
  for (  final MrsImageDataProviderFactory factory : mrsImageProviderFactories.values()) {
    MrsImageDataProvider provider;
    try {
      provider=factory.createTempMrsImageDataProvider(providerProperties);
    }
 catch (    IOException e) {
      throw new DataProviderException("String_Node_Str",e);
    }
    mrsImageProviderCache.put(provider.getResourceName(),provider);
    return provider;
  }
  throw new DataProviderException("String_Node_Str");
}

Fixed version (ground truth):
private static MrsImageDataProvider createTempMrsImageDataProvider(final Configuration conf,final ProviderProperties providerProperties) throws DataProviderNotFound, DataProviderException {
  initialize(conf);
  for (  final MrsImageDataProviderFactory factory : mrsImageProviderFactories.values()) {
    MrsImageDataProvider provider;
    try {
      provider=factory.createTempMrsImageDataProvider(conf,providerProperties);
    }
 catch (    IOException e) {
      throw new DataProviderException("String_Node_Str",e);
    }
    mrsImageProviderCache.put(provider.getResourceName(),provider);
    return provider;
  }
  throw new DataProviderException("String_Node_Str");
}
Program: 94376
Project: 94376
Buggy source:
/** 
 * Returns a list of vectors available from all data sources. The names returned can be subsequently passed as the name parameter to getVectorDataProvider().
 * @return
 * @throws IOException
 */
public static String[] listVectors(final ProviderProperties providerProperties) throws IOException {
  initialize(getBasicConfig());
  List<String> results=new ArrayList<String>();
  for (  final VectorDataProviderFactory factory : vectorProviderFactories.values()) {
    String[] vectors=factory.listVectors(providerProperties);
    if (vectors != null && vectors.length > 0) {
      results.addAll(Arrays.asList(vectors));
    }
  }
  String[] returnValue=new String[results.size()];
  return results.toArray(returnValue);
}

Fixed version (ground truth):
/** 
 * Returns a list of vectors available from all data sources. The names returned can be subsequently passed as the name parameter to getVectorDataProvider().
 * @return
 * @throws IOException
 */
public static String[] listVectors(final ProviderProperties providerProperties) throws IOException {
  Configuration conf=getBasicConfig();
  initialize(conf);
  List<String> results=new ArrayList<String>();
  for (  final VectorDataProviderFactory factory : vectorProviderFactories.values()) {
    String[] vectors=factory.listVectors(conf,providerProperties);
    if (vectors != null && vectors.length > 0) {
      results.addAll(Arrays.asList(vectors));
    }
  }
  String[] returnValue=new String[results.size()];
  return results.toArray(returnValue);
}
Program: 94377
Project: 94377
Buggy source:
private VectorDataProviderFactory findFactory() throws IOException {
  boolean debugEnabled=log.isDebugEnabled();
  if (debugEnabled) {
    log.debug("String_Node_Str" + ((prefix != null) ? prefix : "String_Node_Str") + "String_Node_Str"+ name);
    log.debug("String_Node_Str" + vectorProviderFactories.size());
  }
  if (prefix != null) {
    if (vectorProviderFactories.containsKey(prefix)) {
      if (debugEnabled) {
        log.debug("String_Node_Str" + vectorProviderFactories.get(prefix).getClass().getName());
      }
      return vectorProviderFactories.get(prefix);
    }
  }
  for (  final VectorDataProviderFactory factory : vectorProviderFactories.values()) {
    if (debugEnabled) {
      log.debug("String_Node_Str" + factory.getClass().getName());
    }
    if (factory.exists(name,props)) {
      if (debugEnabled) {
        log.debug("String_Node_Str" + factory.getClass().getName());
      }
      return factory;
    }
    if (debugEnabled) {
      log.debug("String_Node_Str" + name);
    }
  }
  if (debugEnabled) {
    log.debug("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
private VectorDataProviderFactory findFactory() throws IOException {
  boolean debugEnabled=log.isDebugEnabled();
  if (debugEnabled) {
    log.debug("String_Node_Str" + ((prefix != null) ? prefix : "String_Node_Str") + "String_Node_Str"+ name);
    log.debug("String_Node_Str" + vectorProviderFactories.size());
  }
  if (prefix != null) {
    if (vectorProviderFactories.containsKey(prefix)) {
      if (debugEnabled) {
        log.debug("String_Node_Str" + vectorProviderFactories.get(prefix).getClass().getName());
      }
      return vectorProviderFactories.get(prefix);
    }
  }
  for (  final VectorDataProviderFactory factory : vectorProviderFactories.values()) {
    if (debugEnabled) {
      log.debug("String_Node_Str" + factory.getClass().getName());
    }
    if (factory.exists(name,conf,props)) {
      if (debugEnabled) {
        log.debug("String_Node_Str" + factory.getClass().getName());
      }
      return factory;
    }
    if (debugEnabled) {
      log.debug("String_Node_Str" + name);
    }
  }
  if (debugEnabled) {
    log.debug("String_Node_Str");
  }
  return null;
}