Program: 178330
Project: 178330
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.stats);
  ContentResolver mContentResolver=getApplicationContext().getContentResolver();
  String[] mProjection=new String[1];
  mProjection[0]=LocationsContract.Table._ID;
  Cursor mCursor=mContentResolver.query(LocationsContract.CONTENT_URI,mProjection,null,null,null);
  TextView mTextView=(TextView)findViewById(R.id.stats_ui_txt_version);
  try {
    PackageInfo mPackageInfo=getPackageManager().getPackageInfo(getPackageName(),PackageManager.GET_META_DATA);
    mTextView.setText(mPackageInfo.versionName);
    dataElems[0]=mPackageInfo.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str",e);
    mTextView.setText(String.format(getString(R.string.about_ui_lbl_version),getString(R.string.misc_not_available)));
  }
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_locations);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[1]=Integer.toString(mCursor.getCount());
  mCursor.close();
  mProjection[0]=PointsOfInterestContract.Table._ID;
  mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,null,null,null);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_pois);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[2]=Integer.toString(mCursor.getCount());
  mCursor.close();
  String mSelection=PointsOfInterestContract.Table.PHOTO + "String_Node_Str";
  mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,mSelection,null,null);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_photos);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[3]=Integer.toString(mCursor.getCount());
  mCursor.close();
  String[] mSelectionArgs=new String[1];
  ServalMaps mApplication=(ServalMaps)getApplication();
  mSelectionArgs[0]=mApplication.getPhoneNumber();
  mApplication=null;
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_photos_by_you);
  if (mSelectionArgs[0] != null) {
    mSelection=PointsOfInterestContract.Table.PHOTO + "String_Node_Str";
    mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,mSelection,mSelectionArgs,null);
    mTextView.setText(Integer.toString(mCursor.getCount()));
    dataElems[4]=Integer.toString(mCursor.getCount());
    mCursor.close();
  }
 else {
    mTextView.setText(R.string.misc_not_available);
    dataElems[4]=getString(R.string.misc_not_available);
  }
  SharedPreferences mPreferences=getSharedPreferences(CoreService.PREFERENCES_NAME,Context.MODE_PRIVATE);
  long mUptime=mPreferences.getLong(CoreService.PREFERENCES_VALUE,0);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_uptime);
  if (mUptime > 0) {
    mTextView.setText(TimeUtils.getMillisHumanReadable(mUptime,this));
    dataElems[5]=TimeUtils.getMillisHumanReadable(mUptime,this);
  }
 else {
    mTextView.setText(String.format(getString(R.string.misc_age_calculation_seconds),0));
    dataElems[5]="String_Node_Str";
  }
  Button mButton=(Button)findViewById(R.id.stats_ui_btn_send);
  mButton.setOnClickListener(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.stats);
  ContentResolver mContentResolver=getApplicationContext().getContentResolver();
  String[] mProjection=new String[1];
  mProjection[0]=LocationsContract.Table._ID;
  Cursor mCursor=mContentResolver.query(LocationsContract.CONTENT_URI,mProjection,null,null,null);
  TextView mTextView=(TextView)findViewById(R.id.stats_ui_txt_version);
  try {
    PackageInfo mPackageInfo=getPackageManager().getPackageInfo(getPackageName(),PackageManager.GET_META_DATA);
    mTextView.setText(mPackageInfo.versionName);
    dataElems[0]=mPackageInfo.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str",e);
    mTextView.setText(String.format(getString(R.string.about_ui_lbl_version),getString(R.string.misc_not_available)));
  }
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_locations);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[1]=Integer.toString(mCursor.getCount());
  mCursor.close();
  mProjection[0]=PointsOfInterestContract.Table._ID;
  mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,null,null,null);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_pois);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[2]=Integer.toString(mCursor.getCount());
  mCursor.close();
  String mSelection=PointsOfInterestContract.Table.PHOTO + "String_Node_Str";
  mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,mSelection,null,null);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_photos);
  mTextView.setText(Integer.toString(mCursor.getCount()));
  dataElems[3]=Integer.toString(mCursor.getCount());
  mCursor.close();
  String[] mSelectionArgs=new String[1];
  ServalMaps mApplication=(ServalMaps)getApplication();
  mSelectionArgs[0]=mApplication.getPhoneNumber();
  mApplication=null;
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_photos_by_you);
  if (mSelectionArgs[0] != null) {
    mSelection=PointsOfInterestContract.Table.PHONE_NUMBER + "String_Node_Str" + PointsOfInterestContract.Table.PHOTO+ "String_Node_Str";
    mCursor=mContentResolver.query(PointsOfInterestContract.CONTENT_URI,mProjection,mSelection,mSelectionArgs,null);
    mTextView.setText(Integer.toString(mCursor.getCount()));
    dataElems[4]=Integer.toString(mCursor.getCount());
    mCursor.close();
  }
 else {
    mTextView.setText(R.string.misc_not_available);
    dataElems[4]=getString(R.string.misc_not_available);
  }
  SharedPreferences mPreferences=getSharedPreferences(CoreService.PREFERENCES_NAME,Context.MODE_PRIVATE);
  long mUptime=mPreferences.getLong(CoreService.PREFERENCES_VALUE,0);
  mTextView=(TextView)findViewById(R.id.stats_ui_txt_uptime);
  if (mUptime > 0) {
    mTextView.setText(TimeUtils.getMillisHumanReadable(mUptime,this));
    dataElems[5]=Long.toString(mUptime);
  }
 else {
    mTextView.setText(String.format(getString(R.string.misc_age_calculation_seconds),0));
    dataElems[5]="String_Node_Str";
  }
  Button mButton=(Button)findViewById(R.id.stats_ui_btn_send);
  mButton.setOnClickListener(this);
}