Program: 50891
Project: 50891
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dataFetcher=new OCTranspoDataFetcher(this);
  Log.d(TAG,"String_Node_Str");
  db=(new DatabaseHelper(this)).getReadableDatabase();
  Log.d(TAG,"String_Node_Str");
  mapView=(MapView)findViewById(R.id.mapView);
  mapView.setBuiltInZoomControls(true);
  stopNumberField=(EditText)findViewById(R.id.stopNumber);
  routeNumberField=(EditText)findViewById(R.id.routeNumber);
  if (savedInstanceState != null) {
    result=(GetNextTripsForStopResult)savedInstanceState.getSerializable("String_Node_Str");
    stopNumberField.setText(savedInstanceState.getString("String_Node_Str"));
    routeNumberField.setText(savedInstanceState.getString("String_Node_Str"));
  }
  if (result != null) {
    GeoPoint stopLocation=null;
    try {
      getStopLocation(result.getStopNumber());
    }
 catch (    IllegalArgumentException e) {
    }
    displayGetNextTripsForStopResult(result,stopLocation);
  }
 else {
    MapController mapController=mapView.getController();
    mapController.zoomToSpan((globalMaxLatitude - globalMinLatitude),(globalMaxLongitude - globalMinLongitude));
    mapController.setCenter(new GeoPoint((globalMaxLatitude + globalMinLatitude) / 2,(globalMaxLongitude + globalMinLongitude) / 2));
  }
  final Button updateButton=(Button)findViewById(R.id.updateButton);
  updateButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      updateButton.setEnabled(false);
      InputMethodManager imm=(InputMethodManager)BusFollowerActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(updateButton.getWindowToken(),0);
      final String stopNumber=stopNumberField.getText().toString();
      final String routeNumber=routeNumberField.getText().toString();
      new Thread(new Runnable(){
        public void run(){
          GeoPoint stopLocation=null;
          String errorString;
          try {
            stopLocation=getStopLocation(stopNumber);
            result=dataFetcher.getNextTripsForStop(stopNumber,routeNumber);
            errorString=getErrorString(result.getError());
          }
 catch (          IOException e) {
            errorString=BusFollowerActivity.this.getString(R.string.server_error);
          }
catch (          XmlPullParserException e) {
            errorString=BusFollowerActivity.this.getString(R.string.invalid_response);
          }
catch (          IllegalArgumentException e) {
            errorString=e.getMessage();
          }
          final String errorStringFinal=errorString;
          if (errorString != null) {
            BusFollowerActivity.this.runOnUiThread(new Runnable(){
              public void run(){
                AlertDialog.Builder builder=new AlertDialog.Builder(BusFollowerActivity.this);
                builder.setTitle(R.string.error).setMessage(errorStringFinal).setNegativeButton(BusFollowerActivity.this.getString(R.string.ok),new DialogInterface.OnClickListener(){
                  public void onClick(                  DialogInterface dialog,                  int id){
                    dialog.cancel();
                  }
                }
);
                AlertDialog alert=builder.create();
                alert.show();
                updateButton.setEnabled(true);
              }
            }
);
            return;
          }
          BusFollowerActivity.this.displayGetNextTripsForStopResult(result,stopLocation);
          mapView.post(new Runnable(){
            public void run(){
              mapView.invalidate();
              updateButton.setEnabled(true);
            }
          }
);
        }
      }
).start();
    }
  }
);
  routeNumberField.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE) {
        updateButton.performClick();
        return true;
      }
      return false;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dataFetcher=new OCTranspoDataFetcher(this);
  Log.d(TAG,"String_Node_Str");
  db=(new DatabaseHelper(this)).getReadableDatabase();
  Log.d(TAG,"String_Node_Str");
  mapView=(MapView)findViewById(R.id.mapView);
  mapView.setBuiltInZoomControls(true);
  stopNumberField=(EditText)findViewById(R.id.stopNumber);
  routeNumberField=(EditText)findViewById(R.id.routeNumber);
  if (savedInstanceState != null) {
    result=(GetNextTripsForStopResult)savedInstanceState.getSerializable("String_Node_Str");
    stopNumberField.setText(savedInstanceState.getString("String_Node_Str"));
    routeNumberField.setText(savedInstanceState.getString("String_Node_Str"));
  }
  if (result != null) {
    GeoPoint stopLocation=null;
    try {
      stopLocation=getStopLocation(result.getStopNumber());
    }
 catch (    IllegalArgumentException e) {
    }
    displayGetNextTripsForStopResult(result,stopLocation);
  }
 else {
    MapController mapController=mapView.getController();
    mapController.zoomToSpan((globalMaxLatitude - globalMinLatitude),(globalMaxLongitude - globalMinLongitude));
    mapController.setCenter(new GeoPoint((globalMaxLatitude + globalMinLatitude) / 2,(globalMaxLongitude + globalMinLongitude) / 2));
  }
  final Button updateButton=(Button)findViewById(R.id.updateButton);
  updateButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      updateButton.setEnabled(false);
      InputMethodManager imm=(InputMethodManager)BusFollowerActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(updateButton.getWindowToken(),0);
      final String stopNumber=stopNumberField.getText().toString();
      final String routeNumber=routeNumberField.getText().toString();
      new Thread(new Runnable(){
        public void run(){
          GeoPoint stopLocation=null;
          String errorString;
          try {
            stopLocation=getStopLocation(stopNumber);
            result=dataFetcher.getNextTripsForStop(stopNumber,routeNumber);
            errorString=getErrorString(result.getError());
          }
 catch (          IOException e) {
            errorString=BusFollowerActivity.this.getString(R.string.server_error);
          }
catch (          XmlPullParserException e) {
            errorString=BusFollowerActivity.this.getString(R.string.invalid_response);
          }
catch (          IllegalArgumentException e) {
            errorString=e.getMessage();
          }
          final String errorStringFinal=errorString;
          if (errorString != null) {
            BusFollowerActivity.this.runOnUiThread(new Runnable(){
              public void run(){
                AlertDialog.Builder builder=new AlertDialog.Builder(BusFollowerActivity.this);
                builder.setTitle(R.string.error).setMessage(errorStringFinal).setNegativeButton(BusFollowerActivity.this.getString(R.string.ok),new DialogInterface.OnClickListener(){
                  public void onClick(                  DialogInterface dialog,                  int id){
                    dialog.cancel();
                  }
                }
);
                AlertDialog alert=builder.create();
                alert.show();
                updateButton.setEnabled(true);
              }
            }
);
            return;
          }
          BusFollowerActivity.this.displayGetNextTripsForStopResult(result,stopLocation);
          mapView.post(new Runnable(){
            public void run(){
              mapView.invalidate();
              updateButton.setEnabled(true);
            }
          }
);
        }
      }
).start();
    }
  }
);
  routeNumberField.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE) {
        updateButton.performClick();
        return true;
      }
      return false;
    }
  }
);
}