nus-yam/ex-repair huggingface dataset:
Program: 43783
Project: 43783
Buggy source:
@SmallTest public void testOnTransactionRestored() throws Exception {
  final Set<Boolean> flags=new HashSet<Boolean>();
  final IBillingObserver observer=new IBillingObserver(){
    public void onTransactionsRestored(){
      flags.add(true);
    }
    public void onPurchaseIntent(    String itemId,    PendingIntent purchaseIntent){
    }
    public void onBillingChecked(    boolean supported){
    }
    public void onRequestPurchaseResponse(    String itemId,    ResponseCode response){
    }
    public void onPurchaseStateChanged(    String itemId,    PurchaseState state){
    }
    public void onSubscriptionChecked(    boolean supported){
    }
  }
;
  BillingController.registerObserver(observer);
  BillingController.onTransactionsRestored();
  assertEquals(flags.size(),1);
  BillingController.unregisterObserver(observer);
}

Fixed version (ground truth):
@SmallTest public void testOnTransactionRestored() throws Exception {
  final Set<Boolean> flags=new HashSet<Boolean>();
  final IBillingObserver observer=new MockBillingObserver(){
    @Override public void onTransactionsRestored(){
      flags.add(true);
    }
  }
;
  BillingController.registerObserver(observer);
  BillingController.onTransactionsRestored();
  assertEquals(flags.size(),1);
  BillingController.unregisterObserver(observer);
}
Program: 43784
Project: 43784
Buggy source:
public void onSubscriptionChecked(boolean supported){
}

Fixed version (ground truth):
@Override public void onSubscriptionChecked(boolean supported){
  flags.add(true);
  assertFalse(supported);
}
Program: 43785
Project: 43785
Buggy source:
@SmallTest public void testOnRequestPurchaseResponse() throws Exception {
  final String testItemId=TransactionTest.TRANSACTION_1.productId;
  final ResponseCode testResponse=ResponseCode.RESULT_OK;
  final Set<Boolean> flags=new HashSet<Boolean>();
  final IBillingObserver observer=new IBillingObserver(){
    public void onTransactionsRestored(){
    }
    public void onPurchaseIntent(    String itemId,    PendingIntent purchaseIntent){
    }
    public void onBillingChecked(    boolean supported){
    }
    public void onRequestPurchaseResponse(    String itemId,    ResponseCode response){
      flags.add(true);
      assertEquals(testItemId,itemId);
      assertEquals(testResponse,response);
    }
    public void onPurchaseStateChanged(    String itemId,    PurchaseState state){
    }
    public void onSubscriptionChecked(    boolean supported){
    }
  }
;
  BillingController.registerObserver(observer);
  BillingController.onRequestPurchaseResponse(testItemId,testResponse);
  assertEquals(flags.size(),1);
  BillingController.unregisterObserver(observer);
}

Fixed version (ground truth):
@SmallTest public void testOnRequestPurchaseResponse() throws Exception {
  final String testItemId=TransactionTest.TRANSACTION_1.productId;
  final ResponseCode testResponse=ResponseCode.RESULT_OK;
  final Set<Boolean> flags=new HashSet<Boolean>();
  final IBillingObserver observer=new MockBillingObserver(){
    @Override public void onRequestPurchaseResponse(    String itemId,    ResponseCode response){
      flags.add(true);
      assertEquals(testItemId,itemId);
      assertEquals(testResponse,response);
    }
  }
;
  BillingController.registerObserver(observer);
  BillingController.onRequestPurchaseResponse(testItemId,testResponse);
  assertEquals(flags.size(),1);
  BillingController.unregisterObserver(observer);
}
Program: 43786
Project: 43786
Buggy source:
public void onTransactionsRestored(){
}

Fixed version (ground truth):
@Override public void onTransactionsRestored(){
  flags.add(true);
}
Program: 43787
Project: 43787
Buggy source:
public void onRequestPurchaseResponse(String itemId,ResponseCode response){
  flags.add(true);
  assertEquals(testItemId,itemId);
  assertEquals(testResponse,response);
}

Fixed version (ground truth):
@Override public void onRequestPurchaseResponse(String itemId,ResponseCode response){
  flags.add(true);
  assertEquals(testItemId,itemId);
  assertEquals(testResponse,response);
}
Program: 43788
Project: 43788
Buggy source:
public void onBillingChecked(boolean supported){
}

Fixed version (ground truth):
@Override public void onBillingChecked(boolean supported){
  flags.add(true);
  assertFalse(supported);
}
Program: 43792
Project: 43792
Buggy source:
public List<JSONObject> getJSONFromUrl(Context ctx,String url){
  String sb=null;
  String json=null;
  PreyRestHttpClient preyRestHttpClient=PreyRestHttpClient.getInstance(ctx);
  boolean connected=false;
  if (!PreyConfig.getPreyConfig(ctx).isConnectionExists()) {
    PreyWifiManager.getInstance(ctx).setWifiEnabled(true);
    try {
      Thread.sleep(2000);
    }
 catch (    Exception e) {
    }
    connected=true;
  }
  try {
    sb=preyRestHttpClient.getStringUrl(url,PreyConfig.getPreyConfig(ctx));
    if (sb != null)     json=sb.trim();
  }
 catch (  Exception e) {
    PreyLogger.e("String_Node_Str" + e.getMessage(),e);
    return null;
  }
  if (connected) {
    PreyWifiManager.getInstance(ctx).setWifiEnabled(false);
  }
  if ("String_Node_Str".equals(json)) {
    return null;
  }
  return getJSONFromTxt(ctx,json);
}

Fixed version (ground truth):
public List<JSONObject> getJSONFromUrl(Context ctx,String url){
  String sb=null;
  String json=null;
  PreyRestHttpClient preyRestHttpClient=PreyRestHttpClient.getInstance(ctx);
  try {
    sb=preyRestHttpClient.getStringUrl(url,PreyConfig.getPreyConfig(ctx));
    if (sb != null)     json=sb.trim();
  }
 catch (  Exception e) {
    PreyLogger.e("String_Node_Str" + e.getMessage(),e);
    return null;
  }
  if ("String_Node_Str".equals(json)) {
    return null;
  }
  return getJSONFromTxt(ctx,json);
}
Program: 43793
Project: 43793
Buggy source:
@Override public void execute(ActionJob actionJob,Context ctx){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  if (preyConfig.isFroyoOrAbove()) {
    preyConfig.setLock(true);
    preyConfig.setUnlockPass(getConfig().get("String_Node_Str"));
    FroyoSupport.getInstance(ctx).changePasswordAndLock(getConfig().get("String_Node_Str"),true);
  }
}

Fixed version (ground truth):
@Override public void execute(ActionJob actionJob,Context ctx){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  if (preyConfig.isFroyoOrAbove()) {
    preyConfig.setLock(true);
    FroyoSupport.getInstance(ctx).changePasswordAndLock(getConfig().get("String_Node_Str"),true);
  }
}
Program: 43794
Project: 43794
Buggy source:
public void lock(Context ctx,String unlock){
  if (PreyConfig.getPreyConfig(ctx).isFroyoOrAbove()) {
    PreyConfig.getPreyConfig(ctx).setLock(true);
    PreyConfig.getPreyConfig(ctx).setUnlockPass(unlock);
    FroyoSupport.getInstance(ctx).changePasswordAndLock(unlock,true);
    PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx,UtilJson.makeMapParam("String_Node_Str","String_Node_Str","String_Node_Str"));
    PreyConfig.getPreyConfig(ctx).setLastEvent("String_Node_Str");
  }
}

Fixed version (ground truth):
public void lock(Context ctx,String unlock){
  if (PreyConfig.getPreyConfig(ctx).isFroyoOrAbove()) {
    PreyConfig.getPreyConfig(ctx).setLock(true);
    FroyoSupport.getInstance(ctx).changePasswordAndLock(unlock,true);
    PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx,UtilJson.makeMapParam("String_Node_Str","String_Node_Str","String_Node_Str"));
    PreyConfig.getPreyConfig(ctx).setLastEvent("String_Node_Str");
  }
}
Program: 43795
Project: 43795
Buggy source:
public List<HttpDataService> runActionJson(Context ctx,List<JSONObject> jsonObjectList){
  List<HttpDataService> listData=new ArrayList<HttpDataService>();
  int size=jsonObjectList == null ? -1 : jsonObjectList.size();
  PreyLogger.i("String_Node_Str" + size);
  if (size >= 0 && PreyConfig.getPreyConfig(ctx).isNextAlert()) {
    PreyConfig.getPreyConfig(ctx).setNextAlert(false);
    Settings.System.putString(ctx.getContentResolver(),Settings.System.NEXT_ALARM_FORMATTED,"String_Node_Str");
  }
  try {
    for (int i=0; jsonObjectList != null && i < jsonObjectList.size(); i++) {
      JSONObject jsonObject=jsonObjectList.get(i);
      PreyLogger.d("String_Node_Str" + jsonObject);
      String nameAction=jsonObject.getString("String_Node_Str");
      String methodAction=jsonObject.getString("String_Node_Str");
      JSONObject parametersAction=null;
      try {
        parametersAction=jsonObject.getJSONObject("String_Node_Str");
      }
 catch (      JSONException e) {
      }
      PreyLogger.d("String_Node_Str" + nameAction + "String_Node_Str"+ methodAction);
      List<ActionResult> lista=new ArrayList<ActionResult>();
      listData=ClassUtil.execute(ctx,lista,nameAction,methodAction,parametersAction,listData);
    }
    return listData;
  }
 catch (  JSONException e) {
    PreyLogger.e("String_Node_Str" + e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
public List<HttpDataService> runActionJson(Context ctx,List<JSONObject> jsonObjectList){
  List<HttpDataService> listData=new ArrayList<HttpDataService>();
  int size=jsonObjectList == null ? -1 : jsonObjectList.size();
  PreyLogger.i("String_Node_Str" + size);
  try {
    if (size >= 0 && PreyConfig.getPreyConfig(ctx).isNextAlert()) {
      PreyConfig.getPreyConfig(ctx).setNextAlert(false);
      Settings.System.putString(ctx.getContentResolver(),Settings.System.NEXT_ALARM_FORMATTED,"String_Node_Str");
    }
  }
 catch (  Exception e) {
  }
  try {
    for (int i=0; jsonObjectList != null && i < jsonObjectList.size(); i++) {
      JSONObject jsonObject=jsonObjectList.get(i);
      PreyLogger.d("String_Node_Str" + jsonObject);
      String nameAction=jsonObject.getString("String_Node_Str");
      String methodAction=jsonObject.getString("String_Node_Str");
      JSONObject parametersAction=null;
      try {
        parametersAction=jsonObject.getJSONObject("String_Node_Str");
      }
 catch (      JSONException e) {
      }
      PreyLogger.d("String_Node_Str" + nameAction + "String_Node_Str"+ methodAction);
      List<ActionResult> lista=new ArrayList<ActionResult>();
      listData=ClassUtil.execute(ctx,lista,nameAction,methodAction,parametersAction,listData);
    }
    return listData;
  }
 catch (  JSONException e) {
    PreyLogger.e("String_Node_Str" + e.getMessage(),e);
  }
  return null;
}
Program: 43797
Project: 43797
Buggy source:
public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  if (camera != null) {
    Camera.Parameters parameters=camera.getParameters();
    camera.setParameters(parameters);
    camera.startPreview();
  }
}

Fixed version (ground truth):
public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  if (camera != null) {
    try {
      Camera.Parameters parameters=camera.getParameters();
      camera.setParameters(parameters);
    }
 catch (    Exception e) {
    }
    camera.startPreview();
  }
}
Program: 43798
Project: 43798
Buggy source:
public boolean isValid(){
  Calendar cal=Calendar.getInstance();
  cal.setTime(new Date());
  cal.add(Calendar.MINUTE,-10);
  long leastTenMinutes=cal.getTimeInMillis();
  long signalFlareDate=PreyConfig.getPreyConfig(ctx).getSignalFlareDate();
  PreyLogger.d("String_Node_Str" + signalFlareDate + "String_Node_Str"+ sdf.format(new Date(signalFlareDate)));
  PreyLogger.d("String_Node_Str" + leastTenMinutes + "String_Node_Str"+ sdf.format(new Date(leastTenMinutes)));
  if (signalFlareDate == 0 || leastTenMinutes > signalFlareDate) {
    long now=new Date().getTime();
    PreyConfig.getPreyConfig(ctx).setSignalFlareDate(now);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isValid(){
  try {
    Calendar cal=Calendar.getInstance();
    cal.setTime(new Date());
    cal.add(Calendar.MINUTE,-10);
    long leastTenMinutes=cal.getTimeInMillis();
    long signalFlareDate=PreyConfig.getPreyConfig(ctx).getSignalFlareDate();
    PreyLogger.d("String_Node_Str" + signalFlareDate + "String_Node_Str"+ sdf.format(new Date(signalFlareDate)));
    PreyLogger.d("String_Node_Str" + leastTenMinutes + "String_Node_Str"+ sdf.format(new Date(leastTenMinutes)));
    if (signalFlareDate == 0 || leastTenMinutes > signalFlareDate) {
      long now=new Date().getTime();
      PreyConfig.getPreyConfig(ctx).setSignalFlareDate(now);
      return true;
    }
    return false;
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 43799
Project: 43799
Buggy source:
public void run(){
  if (event != null) {
    if (Event.BATTERY_LOW.equals(event.getName())) {
      PreyLogger.d("String_Node_Str" + event.getName());
      if (isValid()) {
        String jsonString="String_Node_Str";
        List<JSONObject> jsonObjectList=new JSONParser().getJSONFromTxt(ctx,jsonString.toString());
        if (jsonObjectList != null && jsonObjectList.size() > 0) {
          ActionsController.getInstance(ctx).runActionJson(ctx,jsonObjectList);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (event != null) {
      if (Event.BATTERY_LOW.equals(event.getName())) {
        PreyLogger.d("String_Node_Str" + event.getName());
        if (isValid()) {
          String jsonString="String_Node_Str";
          List<JSONObject> jsonObjectList=new JSONParser().getJSONFromTxt(ctx,jsonString.toString());
          if (jsonObjectList != null && jsonObjectList.size() > 0) {
            ActionsController.getInstance(ctx).runActionJson(ctx,jsonObjectList);
          }
        }
      }
    }
  }
 catch (  Exception e) {
  }
}
Program: 43800
Project: 43800
Buggy source:
public boolean isMobileAvailable(){
  android.net.NetworkInfo mobile=connectivity.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
  return mobile.isAvailable();
}

Fixed version (ground truth):
public boolean isMobileAvailable(){
  try {
    android.net.NetworkInfo mobile=connectivity.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    return mobile.isAvailable();
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 43801
Project: 43801
Buggy source:
public boolean isMobileConnected(){
  android.net.NetworkInfo mobile=connectivity.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
  return mobile.isConnected();
}

Fixed version (ground truth):
public boolean isMobileConnected(){
  try {
    android.net.NetworkInfo mobile=connectivity.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    return mobile.isConnected();
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 43802
Project: 43802
Buggy source:
public List<HttpDataService> execute(){
  List<HttpDataService> listData=null;
  preyConfig=PreyConfig.getPreyConfig(ctx);
  if (preyConfig.isThisDeviceAlreadyRegisteredWithPrey(true)) {
    PreyTelephonyManager preyTelephony=PreyTelephonyManager.getInstance(ctx);
    PreyConnectivityManager preyConnectivity=PreyConnectivityManager.getInstance(ctx);
    boolean connection=false;
    try {
      while (!connection) {
        connection=preyTelephony.isDataConnectivityEnabled() || preyConnectivity.isConnected();
        if (!connection) {
          PreyLogger.d("String_Node_Str");
          if (!PreyWifiManager.getInstance(ctx).isWifiEnabled())           PreyWifiManager.getInstance(ctx).setWifiEnabled(true);
          if (!NetworkUtils.getNetworkUtils(ctx).isMobileDataEnabled())           NetworkUtils.getNetworkUtils(ctx).enableMobileData(true);
          Thread.sleep(10000);
        }
      }
      List<JSONObject> jsonObject=getInstructions();
      PreyLogger.d("String_Node_Str" + version + "String_Node_Str"+ body);
      if (jsonObject == null || jsonObject.size() == 0) {
        PreyLogger.d("String_Node_Str");
      }
 else {
        PreyLogger.d("String_Node_Str");
        runInstructions(jsonObject);
      }
    }
 catch (    Exception e) {
      PreyLogger.e("String_Node_Str" + e.getMessage(),e);
    }
    PreyLogger.d("String_Node_Str");
  }
  return listData;
}

Fixed version (ground truth):
public void execute(){
  if (PreyConfig.getPreyConfig(ctx).isThisDeviceAlreadyRegisteredWithPrey(true)) {
    PreyTelephonyManager preyTelephony=PreyTelephonyManager.getInstance(ctx);
    PreyConnectivityManager preyConnectivity=PreyConnectivityManager.getInstance(ctx);
    boolean connection=false;
    try {
      while (!connection) {
        connection=preyTelephony.isDataConnectivityEnabled() || preyConnectivity.isConnected();
        if (!connection) {
          PreyLogger.d("String_Node_Str");
          if (!PreyWifiManager.getInstance(ctx).isWifiEnabled())           PreyWifiManager.getInstance(ctx).setWifiEnabled(true);
          if (!NetworkUtils.getNetworkUtils(ctx).isMobileDataEnabled())           NetworkUtils.getNetworkUtils(ctx).enableMobileData(true);
          Thread.sleep(10000);
        }
      }
      List<JSONObject> jsonObject=getInstructions();
      PreyLogger.d("String_Node_Str" + version + "String_Node_Str"+ body);
      if (jsonObject == null || jsonObject.size() == 0) {
        PreyLogger.d("String_Node_Str");
      }
 else {
        PreyLogger.d("String_Node_Str");
        runInstructions(jsonObject);
      }
    }
 catch (    Exception e) {
      PreyLogger.e("String_Node_Str" + e.getMessage(),e);
    }
    PreyLogger.d("String_Node_Str");
  }
  ctx.stopService(new Intent(ctx,PreyBetaRunnerService.class));
}
Program: 43803
Project: 43803
Buggy source:
@Override public void onCreate(){
  PreyBetaActionsRunnner exec=new PreyBetaActionsRunnner();
  running=true;
  startedAt=System.currentTimeMillis();
  exec.run(PreyBetaRunnerService.this);
}

Fixed version (ground truth):
@Override public void onCreate(){
  PreyBetaActionsRunnner exec=new PreyBetaActionsRunnner();
  running=true;
  exec.run(PreyBetaRunnerService.this);
}
Program: 43804
Project: 43804
Buggy source:
@Override public void onDestroy(){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(PreyBetaRunnerService.this);
  preyConfig.setMissing(false);
  NotificationManager nm=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  nm.cancelAll();
  ActionsController.getInstance(PreyBetaRunnerService.this).finishRunningJosb();
  running=false;
}

Fixed version (ground truth):
@Override public void onDestroy(){
  PreyLogger.d("String_Node_Str");
  PreyLogger.d("String_Node_Str");
  PreyConfig preyConfig=PreyConfig.getPreyConfig(PreyBetaRunnerService.this);
  preyConfig.setMissing(false);
  NotificationManager nm=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  nm.cancelAll();
  ActionsController.getInstance(PreyBetaRunnerService.this).finishRunningJosb();
  running=false;
}
Program: 43805
Project: 43805
Buggy source:
@Override protected Void doInBackground(Object... data){
  try {
    Context ctx=(Context)data[1];
    String registration=FileConfigReader.getInstance(ctx).getGcmIdPrefix() + (String)data[0];
    PreyHttpResponse response=PreyWebServices.getInstance().setPushRegistrationId(ctx,registration);
    PreyConfig.getPreyConfig(ctx).setNotificationId(registration);
    PreyLogger.d("String_Node_Str" + response.toString());
    PreyConfig.getPreyConfig(ctx).setRegisterC2dm(true);
    new Thread(new PreyBetaActionsRunner(ctx)).start();
  }
 catch (  Exception e) {
    PreyLogger.e("String_Node_Str" + e.getLocalizedMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Object... data){
  try {
    Context ctx=(Context)data[1];
    String registration=FileConfigReader.getInstance(ctx).getGcmIdPrefix() + (String)data[0];
    PreyHttpResponse response=PreyWebServices.getInstance().setPushRegistrationId(ctx,registration);
    PreyConfig.getPreyConfig(ctx).setNotificationId(registration);
    PreyLogger.d("String_Node_Str" + response.toString());
    PreyConfig.getPreyConfig(ctx).setRegisterC2dm(true);
    startPrey(ctx);
  }
 catch (  Exception e) {
    PreyLogger.e("String_Node_Str" + e.getLocalizedMessage(),e);
  }
  return null;
}
Program: 43806
Project: 43806
Buggy source:
private void handleMessageBeta(Context context,String body,String version){
  PreyLogger.i("String_Node_Str");
  PreyLogger.i("String_Node_Str" + body + "String_Node_Str"+ version);
  new Thread(new PreyBetaActionsRunner(context,body,version)).start();
}

Fixed version (ground truth):
private void handleMessageBeta(Context context,String body,String version){
  PreyLogger.i("String_Node_Str");
  PreyLogger.i("String_Node_Str" + body + "String_Node_Str"+ version);
  startPrey(context);
}
Program: 43807
Project: 43807
Buggy source:
public boolean onPreferenceClick(Preference preference){
  String url=PreyConfig.getPreyConfig(getApplicationContext()).getPreyUrl();
  PreyLogger.d("String_Node_Str" + url);
  Intent internetIntent=new Intent(Intent.ACTION_VIEW);
  internetIntent.setData(Uri.parse(url));
  Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
  startActivity(intent);
  return false;
}

Fixed version (ground truth):
public boolean onPreferenceClick(Preference preference){
  String url=PreyConfig.getPreyConfig(getApplicationContext()).getPreyUrl();
  PreyLogger.d("String_Node_Str" + url);
  Intent internetIntent=new Intent(Intent.ACTION_VIEW);
  internetIntent.setData(Uri.parse(url));
  try {
    Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
    startActivity(intent);
  }
 catch (  Exception e) {
  }
  return false;
}
Program: 43811
Project: 43811
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction() != null && intent.getAction().equals(ACTION)) {
    Bundle bundle=intent.getExtras();
    if (bundle != null) {
      Object[] pdus=(Object[])bundle.get("String_Node_Str");
      String messageSMS="String_Node_Str";
      for (int i=0; i < pdus.length; i++) {
        SmsMessage currentMessage=SmsMessage.createFromPdu((byte[])pdus[i]);
        String phoneNumber=currentMessage.getDisplayOriginatingAddress();
        String senderNum=phoneNumber;
        messageSMS=currentMessage.getDisplayMessageBody();
        PreyLogger.i("String_Node_Str" + senderNum + "String_Node_Str"+ messageSMS);
        executeActions(context,messageSMS,phoneNumber);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction() != null && intent.getAction().equals(ACTION)) {
    Bundle bundle=intent.getExtras();
    if (bundle != null) {
      Object[] pdus=(Object[])bundle.get("String_Node_Str");
      String messageSMS="String_Node_Str";
      for (int i=0; i < pdus.length; i++) {
        SmsMessage currentMessage=SmsMessage.createFromPdu((byte[])pdus[i]);
        String phoneNumber=null;
        try {
          phoneNumber=currentMessage.getDisplayOriginatingAddress();
        }
 catch (        Exception e) {
        }
        try {
          messageSMS=currentMessage.getDisplayMessageBody();
        }
 catch (        Exception e) {
        }
        if (messageSMS != null) {
          PreyLogger.i("String_Node_Str" + phoneNumber + "String_Node_Str"+ messageSMS);
          executeActions(context,messageSMS,phoneNumber);
        }
      }
    }
  }
}
Program: 43813
Project: 43813
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (getPreyConfig().isFroyoOrAbove() && !FroyoSupport.getInstance(this).isAdminActive()) {
    PreyLogger.i("String_Node_Str");
    Intent intent=FroyoSupport.getInstance(getApplicationContext()).getAskForAdminPrivilegesIntent();
    startActivity(intent);
  }
 else {
    PreyLogger.i("String_Node_Str");
    showScreen();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
}
Program: 43814
Project: 43814
Buggy source:
public void onClick(View v){
  Intent intent=new Intent(CongratulationsActivity.this,PreyConfigurationActivity.class);
  startActivity(intent);
}

Fixed version (ground truth):
public void onClick(View v){
  Intent intent=new Intent(CongratulationsActivity.this,PreyConfigurationActivity.class);
  startActivity(intent);
  finish();
}
Program: 43815
Project: 43815
Buggy source:
private void showScreen(){
  setContentView(R.layout.congratulations);
  PreyLogger.i("String_Node_Str");
  Bundle bundle=getIntent().getExtras();
  ((TextView)findViewById(R.id.congrats_h2_text)).setText(bundle.getString("String_Node_Str"));
  getPreyConfig().registerC2dm();
  Button ok=(Button)findViewById(R.id.congrats_btn_ok);
  ok.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(CongratulationsActivity.this,PreyConfigurationActivity.class);
      startActivity(intent);
    }
  }
);
}

Fixed version (ground truth):
private void showScreen(){
  setContentView(R.layout.congratulations);
  Bundle bundle=getIntent().getExtras();
  ((TextView)findViewById(R.id.congrats_h2_text)).setText(bundle.getString("String_Node_Str"));
  getPreyConfig().registerC2dm();
  Button ok=(Button)findViewById(R.id.congrats_btn_ok);
  ok.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(CongratulationsActivity.this,PreyConfigurationActivity.class);
      startActivity(intent);
      finish();
    }
  }
);
}
Program: 43816
Project: 43816
Buggy source:
public static ReportActionResponse parseResponse(String responseAsXML){
  ResponsesXMLHandler responsesHandler=new ResponsesXMLHandler();
  try {
    SAXParserFactory spf=SAXParserFactory.newInstance();
    SAXParser sp=spf.newSAXParser();
    XMLReader xr=sp.getXMLReader();
    xr.setContentHandler(responsesHandler);
    ByteArrayInputStream tobeparsed=new ByteArrayInputStream(responseAsXML.getBytes());
    xr.parse(new InputSource(tobeparsed));
  }
 catch (  FactoryConfigurationError e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return responsesHandler.getActionResponses();
}

Fixed version (ground truth):
public static ReportActionResponse parseResponse(String responseAsXML){
  ResponsesXMLHandler responsesHandler=new ResponsesXMLHandler();
  try {
    SAXParserFactory spf=SAXParserFactory.newInstance();
    SAXParser sp=spf.newSAXParser();
    XMLReader xr=sp.getXMLReader();
    xr.setContentHandler(responsesHandler);
    ByteArrayInputStream tobeparsed=new ByteArrayInputStream(responseAsXML.getBytes("String_Node_Str"));
    InputSource is=new InputSource(tobeparsed);
    is.setEncoding("String_Node_Str");
    xr.parse(is);
  }
 catch (  FactoryConfigurationError e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return responsesHandler.getActionResponses();
}
Program: 43817
Project: 43817
Buggy source:
/** 
 * Gets be called on the following structure: <tag>characters</tag>
 */
@Override public void characters(char ch[],int start,int length){
  if (this.inMissing) {
    String isMissing=new String(ch,start,length);
    actionResponse.setMissing(new Boolean(isMissing));
  }
 else   if (this.inDelay) {
    String delay=new String(ch,start,length);
    actionResponse.setDelay(new Long(delay));
  }
 else   if (this.inPostUrl) {
    String postUrl=new String(ch,start,length);
    PreyConfig.postUrl=postUrl;
  }
 else   if (this.inAlertMessage) {
    String alertMessage=new String(ch,start,length);
    actionResponse.addActionConfigParameter("String_Node_Str","String_Node_Str",alertMessage);
  }
 else   if (this.inUnlockPass) {
    String unlockPass=new String(ch,start,length);
    actionResponse.addActionConfigParameter("String_Node_Str","String_Node_Str",unlockPass);
  }
}

Fixed version (ground truth):
/** 
 * Gets be called on the following structure: <tag>characters</tag>
 */
@Override public void characters(char ch[],int start,int length){
  if (this.inMissing) {
    String isMissing=new String(ch,start,length);
    actionResponse.setMissing(new Boolean(isMissing));
  }
 else   if (this.inDelay) {
    String delay=new String(ch,start,length);
    actionResponse.setDelay(new Long(delay));
  }
 else   if (this.inPostUrl) {
    String postUrl=new String(ch,start,length);
    PreyConfig.postUrl=postUrl;
  }
 else   if (this.inAlertMessage) {
    alertMessage=alertMessage.concat(new String(ch,start,length));
    actionResponse.addActionConfigParameter("String_Node_Str","String_Node_Str",alertMessage);
  }
 else   if (this.inUnlockPass) {
    String unlockPass=new String(ch,start,length);
    actionResponse.addActionConfigParameter("String_Node_Str","String_Node_Str",unlockPass);
  }
}
Program: 43818
Project: 43818
Buggy source:
/** 
 * Gets be called on closing tags like: </tag>
 */
@Override public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (localName.equals("String_Node_Str")) {
    this.inMissing=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inDelay=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inPostUrl=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inModules=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inModule=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inAlertMessage=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inUnlockPass=false;
  }
}

Fixed version (ground truth):
/** 
 * Gets be called on closing tags like: </tag>
 */
@Override public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (localName.equals("String_Node_Str")) {
    this.inMissing=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inDelay=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inPostUrl=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inModules=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inModule=false;
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inAlertMessage=false;
    this.alertMessage="String_Node_Str";
  }
 else   if (localName.equals("String_Node_Str")) {
    this.inUnlockPass=false;
  }
}
Program: 43819
Project: 43819
Buggy source:
private void showWelcomeScreen(){
  setContentView(R.layout.welcome);
  Button newUser=(Button)findViewById(R.id.btn_welcome_newuser);
  Button oldUser=(Button)findViewById(R.id.btn_welcome_olduser);
  newUser.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(WelcomeActivity.this,CreateAccountActivity.class);
      startActivityForResult(intent,ADD_THIS_DEVICE);
    }
  }
);
  oldUser.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(WelcomeActivity.this,AddDeviceToAccountActivity.class);
      startActivityForResult(intent,CREATE_ACCOUNT);
    }
  }
);
}

Fixed version (ground truth):
private void showWelcomeScreen(){
  setContentView(R.layout.welcome);
  Button newUser=(Button)findViewById(R.id.btn_welcome_newuser);
  Button oldUser=(Button)findViewById(R.id.btn_welcome_olduser);
  newUser.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(WelcomeActivity.this,CreateAccountActivity.class);
      startActivityForResult(intent,CREATE_ACCOUNT);
    }
  }
);
  oldUser.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Intent intent=new Intent(WelcomeActivity.this,AddDeviceToAccountActivity.class);
      startActivityForResult(intent,ADD_THIS_DEVICE);
    }
  }
);
}
Program: 43820
Project: 43820
Buggy source:
public static void startPrey(Context ctx){
  PreyConfig config=PreyConfig.getPreyConfig(ctx);
  if (config.isThisDeviceAlreadyRegisteredWithPrey(true)) {
    NotificationManager nm=(NotificationManager)ctx.getSystemService(Context.NOTIFICATION_SERVICE);
    nm.cancelAll();
    boolean isPhoneConnected=false;
    final TelephonyManager tm=(TelephonyManager)ctx.getSystemService(Context.TELEPHONY_SERVICE);
    final ConnectivityManager connectivityManager=(ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo activeNetInfo=connectivityManager.getActiveNetworkInfo();
    try {
      isPhoneConnected=(tm.getDataState() == TelephonyManager.DATA_CONNECTED) || activeNetInfo.isConnected();
      while (!isPhoneConnected) {
        isPhoneConnected=(tm.getDataState() == TelephonyManager.DATA_CONNECTED) || activeNetInfo.isConnected();
        PreyLogger.d("String_Node_Str");
        Thread.sleep(5000);
      }
    }
 catch (    InterruptedException e1) {
      PreyLogger.e("String_Node_Str",e1);
    }
catch (    NullPointerException npe) {
      PreyLogger.e("String_Node_Str",npe);
    }
    ctx.stopService(new Intent(ctx,PreyRunnerService.class));
    ctx.startService(new Intent(ctx,PreyRunnerService.class));
  }
}

Fixed version (ground truth):
public static void startPrey(Context ctx){
  PreyConfig config=PreyConfig.getPreyConfig(ctx);
  if (config.isThisDeviceAlreadyRegisteredWithPrey(true)) {
    NotificationManager nm=(NotificationManager)ctx.getSystemService(Context.NOTIFICATION_SERVICE);
    nm.cancelAll();
    boolean isPhoneConnected=false;
    final TelephonyManager tm=(TelephonyManager)ctx.getSystemService(Context.TELEPHONY_SERVICE);
    final ConnectivityManager connectivityManager=(ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo activeNetInfo=connectivityManager.getActiveNetworkInfo();
    try {
      isPhoneConnected=(tm.getDataState() == TelephonyManager.DATA_CONNECTED) || activeNetInfo.isConnected();
      while (!isPhoneConnected) {
        isPhoneConnected=(tm.getDataState() == TelephonyManager.DATA_CONNECTED) || activeNetInfo.isConnected();
        PreyLogger.d("String_Node_Str");
        Thread.sleep(10000);
      }
    }
 catch (    InterruptedException e1) {
      PreyLogger.e("String_Node_Str",e1);
    }
catch (    NullPointerException npe) {
      PreyLogger.e("String_Node_Str",npe);
    }
    ctx.stopService(new Intent(ctx,PreyRunnerService.class));
    ctx.startService(new Intent(ctx,PreyRunnerService.class));
  }
}
Program: 43821
Project: 43821
Buggy source:
public void changePasswordAndLock(String newPass,boolean lock){
  if (isAdminActive()) {
    policyManager.resetPassword(newPass,DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
    if (lock)     policyManager.lockNow();
  }
}

Fixed version (ground truth):
public void changePasswordAndLock(String newPass,boolean lock){
  try {
    if (isAdminActive()) {
      policyManager.resetPassword(newPass,DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
      if (lock)       policyManager.lockNow();
    }
  }
 catch (  Exception e) {
    PreyLogger.e("String_Node_Str",e);
  }
}
Program: 43822
Project: 43822
Buggy source:
private void updateDeviceAttribute(Context ctx,String key,String value){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  parameters.put("String_Node_Str" + key + "String_Node_Str",value);
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str"),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str" + key + "String_Node_Str"+ value);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void updateDeviceAttribute(Context ctx,String key,String value){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  parameters.put("String_Node_Str" + key + "String_Node_Str",value);
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(this.getDeviceUrl(ctx),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str" + key + "String_Node_Str"+ value);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  PreyException e) {
    PreyLogger.e("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str",e);
  }
}
Program: 43823
Project: 43823
Buggy source:
public String getActionsToPerform(Context ctx) throws PreyException {
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  Map<String,String> parameters=new HashMap<String,String>();
  try {
    return PreyRestHttpClient.getInstance(ctx).get(PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str"),parameters,preyConfig).getResponseAsString();
  }
 catch (  IOException e) {
    throw new PreyException(ctx.getText(R.string.error_communication_exception).toString(),e);
  }
}

Fixed version (ground truth):
public String getActionsToPerform(Context ctx) throws PreyException {
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  Map<String,String> parameters=new HashMap<String,String>();
  try {
    return PreyRestHttpClient.getInstance(ctx).get(this.getDeviceUrl(ctx),parameters,preyConfig).getResponseAsString();
  }
 catch (  IOException e) {
    throw new PreyException(ctx.getText(R.string.error_communication_exception).toString(),e);
  }
}
Program: 43824
Project: 43824
Buggy source:
public String deleteDevice(Context ctx) throws PreyException {
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  String xml;
  try {
    xml=PreyRestHttpClient.getInstance(ctx).delete(PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str"),parameters,preyConfig).getResponseAsString();
  }
 catch (  IOException e) {
    throw new PreyException(ctx.getText(R.string.error_communication_exception).toString(),e);
  }
  return xml;
}

Fixed version (ground truth):
public String deleteDevice(Context ctx) throws PreyException {
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  String xml;
  try {
    xml=PreyRestHttpClient.getInstance(ctx).delete(this.getDeviceUrl(ctx),parameters,preyConfig).getResponseAsString();
  }
 catch (  IOException e) {
    throw new PreyException(ctx.getText(R.string.error_communication_exception).toString(),e);
  }
  return xml;
}
Program: 43825
Project: 43825
Buggy source:
public void deactivateModules(Context ctx,ArrayList<String> modules){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  for (  String module : modules) {
    parameters.put("String_Node_Str",module);
  }
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str"),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void deactivateModules(Context ctx,ArrayList<String> modules){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  for (  String module : modules) {
    parameters.put("String_Node_Str",module);
  }
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(this.getDeviceUrl(ctx),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  PreyException e) {
    PreyLogger.e("String_Node_Str",e);
  }
}
Program: 43826
Project: 43826
Buggy source:
public void setMissing(Context ctx,boolean isMissing){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  if (isMissing)   parameters.put("String_Node_Str","String_Node_Str");
 else   parameters.put("String_Node_Str","String_Node_Str");
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str"),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str" + isMissing + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setMissing(Context ctx,boolean isMissing){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  if (isMissing)   parameters.put("String_Node_Str","String_Node_Str");
 else   parameters.put("String_Node_Str","String_Node_Str");
  try {
    PreyRestHttpClient.getInstance(ctx).methodAsParameter(this.getDeviceUrl(ctx),"String_Node_Str",parameters,preyConfig);
    PreyLogger.d("String_Node_Str" + isMissing + "String_Node_Str");
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  PreyException e) {
    PreyLogger.e("String_Node_Str",e);
  }
}
Program: 43827
Project: 43827
Buggy source:
public String getDeviceWebControlPanelUrl(Context ctx){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  return PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID());
}

Fixed version (ground truth):
public String getDeviceWebControlPanelUrl(Context ctx) throws PreyException {
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  String deviceKey=preyConfig.getDeviceID();
  if (deviceKey == null || deviceKey == "String_Node_Str")   throw new PreyException("String_Node_Str");
  return PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(deviceKey);
}
Program: 43828
Project: 43828
Buggy source:
public String sendPreyHttpReport(Context ctx,ArrayList<HttpDataService> dataToSend){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  String URL=PreyConfig.postUrl != null ? PreyConfig.postUrl : PreyConfig.getPreyConfig(ctx).getPreyUrl().concat("String_Node_Str").concat(preyConfig.getDeviceID()).concat("String_Node_Str");
  PreyConfig.postUrl=null;
  HashMap<String,String> parameters=new HashMap<String,String>();
  for (  HttpDataService httpDataService : dataToSend) {
    parameters.putAll(httpDataService.getDataAsParameters());
  }
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  String response=null;
  try {
    response=PreyRestHttpClient.getInstance(ctx).post(URL,parameters,preyConfig).getResponseAsString();
    PreyLogger.d("String_Node_Str" + response);
    if (preyConfig.isShouldNotify()) {
      this.notifyUser(ctx);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return response;
}

Fixed version (ground truth):
public String sendPreyHttpReport(Context ctx,ArrayList<HttpDataService> dataToSend){
  PreyConfig preyConfig=PreyConfig.getPreyConfig(ctx);
  HashMap<String,String> parameters=new HashMap<String,String>();
  for (  HttpDataService httpDataService : dataToSend) {
    parameters.putAll(httpDataService.getDataAsParameters());
  }
  parameters.put("String_Node_Str",preyConfig.getApiKey());
  String response=null;
  try {
    String URL=PreyConfig.postUrl != null ? PreyConfig.postUrl : this.getDeviceWebControlPanelUrl(ctx).concat("String_Node_Str");
    PreyConfig.postUrl=null;
    response=PreyRestHttpClient.getInstance(ctx).post(URL,parameters,preyConfig).getResponseAsString();
    PreyLogger.d("String_Node_Str" + response);
    if (preyConfig.isShouldNotify()) {
      this.notifyUser(ctx);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  PreyException e) {
    PreyLogger.e("String_Node_Str",e);
  }
  return response;
}
Program: 43829
Project: 43829
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (mArrivalsListHeader != null && mSlidingPanel != null) {
    mArrivalsListHeader.setSlidingPanelCollapsed(isSlidingPanelCollapsed());
  }
  checkLeftHandMode();
  updateLayersFabVisibility();
  mFabMyLocation.requestLayout();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (mArrivalsListHeader != null && mSlidingPanel != null) {
    mArrivalsListHeader.setSlidingPanelCollapsed(isSlidingPanelCollapsed());
  }
  checkLeftHandMode();
  updateLayersFab();
  mFabMyLocation.requestLayout();
}
Program: 43830
Project: 43830
Buggy source:
@Override public void onRegionTaskFinished(boolean currentRegionChanged){
  boolean update=autoShowWhatsNew();
  if (currentRegionChanged || update) {
    redrawNavigationDrawerFragment();
  }
  if (currentRegionChanged && Application.getPrefs().getBoolean(getString(R.string.preference_key_auto_select_region),true) && Application.get().getCurrentRegion() != null && UIUtils.canManageDialog(this)) {
    Toast.makeText(getApplicationContext(),getString(R.string.region_region_found,Application.get().getCurrentRegion().getName()),Toast.LENGTH_LONG).show();
  }
  updateLayersFabVisibility();
}

Fixed version (ground truth):
@Override public void onRegionTaskFinished(boolean currentRegionChanged){
  boolean update=autoShowWhatsNew();
  if (currentRegionChanged || update) {
    redrawNavigationDrawerFragment();
  }
  if (currentRegionChanged && Application.getPrefs().getBoolean(getString(R.string.preference_key_auto_select_region),true) && Application.get().getCurrentRegion() != null && UIUtils.canManageDialog(this)) {
    Toast.makeText(getApplicationContext(),getString(R.string.region_region_found,Application.get().getCurrentRegion().getName()),Toast.LENGTH_LONG).show();
  }
  updateLayersFab();
}
Program: 43831
Project: 43831
Buggy source:
private void setupLayersSpeedDial(){
  mLayersFab=(uk.co.markormesher.android_fab.FloatingActionButton)findViewById(R.id.layersSpeedDial);
  ViewGroup.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)mLayersFab.getLayoutParams();
  LAYERS_FAB_DEFAULT_BOTTOM_MARGIN=p.bottomMargin;
  mLayersFab.setIcon(R.drawable.ic_layers_white_24dp);
  mLayersFab.setBackgroundColour(ContextCompat.getColor(this,R.color.theme_accent));
  LayersSpeedDialAdapter adapter=new LayersSpeedDialAdapter(this);
  adapter.addLayerActivationListener(mMapFragment);
  adapter.addLayerActivationListener(new LayersSpeedDialAdapter.LayerActivationListener(){
    @Override public void onActivateLayer(    LayerInfo layer){
      Handler h=new Handler(getMainLooper());
      h.postDelayed(new Runnable(){
        @Override public void run(){
          mLayersFab.rebuildSpeedDialMenu();
        }
      }
,100);
    }
    @Override public void onDeactivateLayer(    LayerInfo layer){
      Handler h=new Handler(getMainLooper());
      h.postDelayed(new Runnable(){
        @Override public void run(){
          mLayersFab.rebuildSpeedDialMenu();
        }
      }
,100);
    }
  }
);
  mLayersFab.setMenuAdapter(adapter);
  mLayersFab.setOnSpeedDialOpenListener(new uk.co.markormesher.android_fab.FloatingActionButton.OnSpeedDialOpenListener(){
    @Override public void onOpen(    uk.co.markormesher.android_fab.FloatingActionButton v){
      mLayersFab.setIcon(R.drawable.ic_add_white_24dp);
    }
  }
);
  mLayersFab.setOnSpeedDialCloseListener(new uk.co.markormesher.android_fab.FloatingActionButton.OnSpeedDialCloseListener(){
    @Override public void onClose(    uk.co.markormesher.android_fab.FloatingActionButton v){
      mLayersFab.setIcon(R.drawable.ic_layers_white_24dp);
    }
  }
);
  mLayersFab.setContentCoverEnabled(false);
}

Fixed version (ground truth):
private void setupLayersSpeedDial(){
  mLayersFab=(uk.co.markormesher.android_fab.FloatingActionButton)findViewById(R.id.layersSpeedDial);
  ViewGroup.MarginLayoutParams p=(ViewGroup.MarginLayoutParams)mLayersFab.getLayoutParams();
  LAYERS_FAB_DEFAULT_BOTTOM_MARGIN=p.bottomMargin;
}