Program: 10412
Project: 10412
Buggy source:
/** 
 * This method is invoked when the user hits "Done" in the setup view controller. The options chosen by the user are passed in as a map. The keys for this map are declared in SetupViewController.
 */
@Override public void didFinishSetup(SetupViewController viewController,Map<String,Double> setupInfo){
  startButton.setAlpha(0);
  descriptionLabel.setAlpha(0);
  tableView.setAlpha(1);
  locationManager=new CLLocationManager();
  locationManager.setDelegate(new CLLocationManagerDelegateAdapter(){
    /** 
 * We want to get and store a location measurement that meets the desired accuracy. For this example, we are going to use horizontal accuracy as the deciding factor. In other cases, you may wish to use vertical accuracy, or both together.
 */
    @Override public void didUpdateToLocation(    CLLocationManager manager,    CLLocation newLocation,    CLLocation oldLocation){
      if (newLocation.getHorizontalAccuracy() < 0)       return;
      double locationAge=-newLocation.getTimestamp().getTimeIntervalSinceNow();
      if (locationAge > 5.0)       return;
      locationMeasurements.add(newLocation);
      tableView.reloadData();
    }
    @Override public void didFail(    CLLocationManager manager,    NSError error){
      if (error.getErrorCode() != CLErrorCode.LocationUnknown) {
        stopUpdatingLocation(Str.getLocalizedString("String_Node_Str"));
      }
    }
  }
);
  locationManager.setDesiredAccuracy(setupInfo.get(SetupViewController.SETUP_INFO_KEY_ACCURACY));
  locationManager.setDistanceFilter(setupInfo.get(SetupViewController.SETUP_INFO_KEY_DISTANCE_FILTER));
  if (Foundation.getMajorSystemVersion() >= 8) {
    locationManager.requestWhenInUseAuthorization();
  }
  locationManager.startUpdatingLocation();
  stateString=Str.getLocalizedString("String_Node_Str");
  tableView.reloadData();
  UIBarButtonItem resetItem=new UIBarButtonItem(Str.getLocalizedString("String_Node_Str"),UIBarButtonItemStyle.Plain,new UIBarButtonItem.OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      reset();
    }
  }
);
  getNavigationItem().setLeftBarButtonItem(resetItem,true);
}

Fixed version (ground truth):
/** 
 * This method is invoked when the user hits "Done" in the setup view controller. The options chosen by the user are passed in as a map. The keys for this map are declared in SetupViewController.
 */
@Override public void didFinishSetup(SetupViewController viewController,Map<String,Double> setupInfo){
  startButton.setAlpha(0);
  descriptionLabel.setAlpha(0);
  tableView.setAlpha(1);
  locationManager=new CLLocationManager();
  locationManager.setDelegate(new CLLocationManagerDelegateAdapter(){
    /** 
 * We want to get and store a location measurement that meets the desired accuracy. For this example, we are going to use horizontal accuracy as the deciding factor. In other cases, you may wish to use vertical accuracy, or both together.
 */
    @Override public void didUpdateLocations(    CLLocationManager manager,    NSArray<CLLocation> locations){
      CLLocation newLocation=locations.last();
      if (newLocation.getHorizontalAccuracy() < 0)       return;
      double locationAge=-newLocation.getTimestamp().getTimeIntervalSinceNow();
      if (locationAge > 5.0)       return;
      locationMeasurements.add(newLocation);
      tableView.reloadData();
    }
    @Override public void didFail(    CLLocationManager manager,    NSError error){
      if (error.getErrorCode() != CLErrorCode.LocationUnknown) {
        stopUpdatingLocation(Str.getLocalizedString("String_Node_Str"));
      }
    }
  }
);
  locationManager.setDesiredAccuracy(setupInfo.get(SetupViewController.SETUP_INFO_KEY_ACCURACY));
  locationManager.setDistanceFilter(setupInfo.get(SetupViewController.SETUP_INFO_KEY_DISTANCE_FILTER));
  if (Foundation.getMajorSystemVersion() >= 8) {
    locationManager.requestWhenInUseAuthorization();
  }
  locationManager.startUpdatingLocation();
  stateString=Str.getLocalizedString("String_Node_Str");
  tableView.reloadData();
  UIBarButtonItem resetItem=new UIBarButtonItem(Str.getLocalizedString("String_Node_Str"),UIBarButtonItemStyle.Plain,new UIBarButtonItem.OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      reset();
    }
  }
);
  getNavigationItem().setLeftBarButtonItem(resetItem,true);
}