Program: 3093
Project: 3093
Buggy source:
@Override public IBinder onBind(Intent intent){
  return new IMobility.Stub(){
    public void stopMobility(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      if (settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
        Editor editor=settings.edit();
        editor.putBoolean(MobilityControl.MOBILITY_ON,false);
        editor.commit();
        Log.e(TAG,"String_Node_Str");
        Mobility.stop(getApplicationContext());
      }
 else {
        Log.e(TAG,"String_Node_Str");
      }
    }
    public void startMobility(){
      Log.e(TAG,"String_Node_Str");
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      if (!settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
        Editor editor=settings.edit();
        editor.putBoolean(MobilityControl.MOBILITY_ON,true);
        editor.commit();
        Log.e(TAG,"String_Node_Str");
        Mobility.start(getApplicationContext());
      }
 else {
        Log.e(TAG,"String_Node_Str");
      }
      Log.e(TAG,"String_Node_Str");
    }
    /** 
 * Set the rate in seconds to 300, 60, 30, or 15.
 * @param context
 * @param intervalInSeconds This must be 300, 60, 30, or 15.
 * @return true if successful, false otherwise
 */
    public boolean changeMobilityRate(    int intervalInSeconds){
      for (      int rate : new int[]{300,60,30,15})       if (intervalInSeconds == rate) {
        SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
        Editor editor=settings.edit();
        editor.putInt(Mobility.SAMPLE_RATE,intervalInSeconds);
        editor.commit();
        if (settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
          stopMobility();
          startMobility();
        }
        return true;
      }
      return false;
    }
    public boolean isMobilityOn(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      return settings.getBoolean(MobilityControl.MOBILITY_ON,false);
    }
    public int getMobilityInterval(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      return settings.getInt(Mobility.SAMPLE_RATE,60);
    }
  }
;
}

Fixed version (ground truth):
@Override public IBinder onBind(Intent intent){
  Mobility.initSystemLog(getApplicationContext());
  return new IMobility.Stub(){
    public void stopMobility(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      if (settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
        Editor editor=settings.edit();
        editor.putBoolean(MobilityControl.MOBILITY_ON,false);
        editor.commit();
        Log.e(TAG,"String_Node_Str");
        Mobility.stop(getApplicationContext());
      }
 else {
        Log.e(TAG,"String_Node_Str");
      }
    }
    public void startMobility(){
      Log.e(TAG,"String_Node_Str");
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      if (!settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
        Editor editor=settings.edit();
        editor.putBoolean(MobilityControl.MOBILITY_ON,true);
        editor.commit();
        Log.e(TAG,"String_Node_Str");
        Mobility.start(getApplicationContext());
      }
 else {
        Log.e(TAG,"String_Node_Str");
      }
      Log.e(TAG,"String_Node_Str");
    }
    /** 
 * Set the rate in seconds to 300, 60, 30, or 15.
 * @param context
 * @param intervalInSeconds This must be 300, 60, 30, or 15.
 * @return true if successful, false otherwise
 */
    public boolean changeMobilityRate(    int intervalInSeconds){
      for (      int rate : new int[]{300,60,30,15})       if (intervalInSeconds == rate) {
        SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
        Editor editor=settings.edit();
        editor.putInt(Mobility.SAMPLE_RATE,intervalInSeconds);
        editor.commit();
        if (settings.getBoolean(MobilityControl.MOBILITY_ON,false)) {
          stopMobility();
          startMobility();
        }
        return true;
      }
      return false;
    }
    public boolean isMobilityOn(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      return settings.getBoolean(MobilityControl.MOBILITY_ON,false);
    }
    public int getMobilityInterval(){
      SharedPreferences settings=getSharedPreferences(Mobility.MOBILITY,Context.MODE_PRIVATE);
      return settings.getInt(Mobility.SAMPLE_RATE,60);
    }
  }
;
}