Program: 13503
Project: 13503
Buggy source:
public GpsConnection(Context context){
  Logger.w(TAG,"String_Node_Str");
  llGPS=new MyLocationListener();
  llNetwork=new MyLocationListener();
  gpsListener=new MyGpsListener();
  isFixed=false;
  locationManager=(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
  providers=locationManager.getAllProviders();
  try {
    locationManager.removeUpdates(llGPS);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  try {
    locationManager.removeUpdates(llNetwork);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  if (providers.contains(LocationManager.NETWORK_PROVIDER)) {
    try {
      locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,Preferences.GPS_MIN_TIME * 1000,0,llNetwork);
      networkProviderEnabled=true;
    }
 catch (    Exception e) {
      Logger.w(TAG,"String_Node_Str" + e);
      networkProviderEnabled=false;
    }
  }
  if (providers.contains(LocationManager.GPS_PROVIDER)) {
    try {
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,Preferences.GPS_MIN_TIME * 1000,0,llGPS);
      gpsProviderEnabled=true;
    }
 catch (    Exception e) {
      Logger.w(TAG,"String_Node_Str" + e);
      gpsProviderEnabled=false;
    }
  }
  try {
    locationManager.addGpsStatusListener(gpsListener);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  if (networkProviderEnabled || gpsProviderEnabled) {
    ManagerNotify.toastShortMessage(context,context.getString(R.string.gps_enabled));
  }
 else {
    if (PreferenceValues.getCurrentActivity() != null) {
      UtilsGUI.showDialogInfo(PreferenceValues.getCurrentActivity(),R.string.no_location_providers_available);
    }
    LocationState.setGpsOff(context);
    destroy();
  }
}

Fixed version (ground truth):
public GpsConnection(Context context){
  Logger.w(TAG,"String_Node_Str");
  llGPS=new MyLocationListener();
  llNetwork=new MyLocationListener();
  gpsListener=new MyGpsListener();
  isFixed=false;
  locationManager=(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
  List<String> providers=locationManager.getAllProviders();
  try {
    locationManager.removeUpdates(llGPS);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  try {
    locationManager.removeUpdates(llNetwork);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  if (providers.contains(LocationManager.NETWORK_PROVIDER)) {
    try {
      locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,Preferences.GPS_MIN_TIME * 1000,0,llNetwork);
      networkProviderEnabled=true;
    }
 catch (    Exception e) {
      Logger.w(TAG,"String_Node_Str" + e);
      networkProviderEnabled=false;
    }
  }
  if (providers.contains(LocationManager.GPS_PROVIDER)) {
    try {
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,Preferences.GPS_MIN_TIME * 1000,0,llGPS);
      gpsProviderEnabled=true;
    }
 catch (    Exception e) {
      Logger.w(TAG,"String_Node_Str" + e);
      gpsProviderEnabled=false;
    }
  }
  try {
    locationManager.addGpsStatusListener(gpsListener);
  }
 catch (  Exception e) {
    Logger.w(TAG,"String_Node_Str" + e);
  }
  if (networkProviderEnabled || gpsProviderEnabled) {
    ManagerNotify.toastShortMessage(context,context.getString(R.string.gps_enabled));
  }
 else {
    if (PreferenceValues.getCurrentActivity() != null) {
      UtilsGUI.showDialogInfo(PreferenceValues.getCurrentActivity(),R.string.no_location_providers_available);
    }
    LocationState.setGpsOff(context);
    destroy();
  }
}